-
Notifications
You must be signed in to change notification settings - Fork 17
fix(mixins): improve focus-visible visualisation #4022
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -15,8 +15,8 @@ | |||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| &:focus-visible { | ||||||||||||||
| outline: none; | ||||||||||||||
| box-shadow: var(--shadow-depth-8-focused); | ||||||||||||||
| outline: var(--outline-focus-visible); | ||||||||||||||
| outline-offset: 0.03125rem; // 0.5px | ||||||||||||||
|
Comment on lines
+18
to
+19
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Use the shared outline-offset token here for consistency. Line 19 hardcodes offset while the PR introduces ♻️ Suggested patch- outline-offset: 0.03125rem; // 0.5px
+ outline-offset: var(--outline-focus-visible-offset);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
|
|
@@ -602,7 +602,9 @@ $clickable-normal-state-transitions: ( | |||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| &:focus-visible { | ||||||||||||||
| box-shadow: var(--shadow-depth-8-focused), var(--button-shadow-hovered); | ||||||||||||||
| // box-shadow: var(--shadow-depth-8-focused), var(--button-shadow-hovered); | ||||||||||||||
| outline: var(--outline-focus-visible); | ||||||||||||||
| outline-offset: var(--outline-focus-visible-offset); | ||||||||||||||
|
Comment on lines
+605
to
+607
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Verify mixin consumers and check for overflow clipping risk.
rg -nP '@include\s+the-3d-element--clickable\b' -g '**/*.scss' -C2
rg -nP 'overflow\s*:\s*hidden\s*;' -g '**/*.scss' -C2Repository: Lundalogik/lime-elements Length of output: 12528 🏁 Script executed: # Search for the mixin definition
rg -n '@mixin the-3d-element--clickable' src/style/mixins.scss
# Check info-tile.scss to see how it actually uses styles
cat -n src/components/info-tile/info-tile.scss | head -100
# Search for the mixin in all files with variations
rg -n 'the-3d-element--clickable' -g '**/*.scss'Repository: Lundalogik/lime-elements Length of output: 4483 🏁 Script executed: # Check the context around line 403 in info-tile.scss
sed -n '395,415p' src/components/info-tile/info-tile.scss
# View the mixin definition
sed -n '589,620p' src/style/mixins.scssRepository: Lundalogik/lime-elements Length of output: 1196 🏁 Script executed: # Check for --shadow-focused-state variable
rg -n '--shadow-focused-state' -g '**/*.scss'
# Check for --shadow-depth-8-focused variable
rg -n '--shadow-depth-8-focused' -g '**/*.scss'
# Look for shadow variable definitions
rg -n 'shadow.*focused|focused.*shadow' -g '**/*.scss' | head -20Repository: Lundalogik/lime-elements Length of output: 2832 🏁 Script executed: # Check other focus-visible implementations
rg -B2 -A2 '&:focus-visible' src/components -g '*.scss' | head -60
# Also check the shadows file to understand the variables better
sed -n '10,80p' src/style/shadows.scssRepository: Lundalogik/lime-elements Length of output: 7458 Outline-only focus indicator can be clipped in
♻️ Suggested fix (restore box-shadow for focus state) &:focus-visible {
- outline: var(--outline-focus-visible);
- outline-offset: var(--outline-focus-visible-offset);
+ box-shadow: var(--shadow-depth-8-focused), var(--button-shadow-hovered);
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| &:focus-visible:active { | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick bad not… just writing so we don't forget. Many components don't use our "clickable" mixins, and replicate them. They also add transitions for box-shadow. Now that we are changing this to
outline, we need to make sure that those transitions are updated if necessary. I'll elaborate later