-
Notifications
You must be signed in to change notification settings - Fork 0
🎨 Palette: Add global focus-visible styles #98
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
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 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -124,6 +124,12 @@ body { | |||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
| /* Focus-visible for accessibility */ | ||||||||||||||||||
| :focus-visible { | ||||||||||||||||||
| outline: 2px solid var(--color-primary); | ||||||||||||||||||
| outline-offset: 2px; | ||||||||||||||||||
|
Comment on lines
+128
to
+130
|
||||||||||||||||||
| :focus-visible { | |
| outline: 2px solid var(--color-primary); | |
| outline-offset: 2px; | |
| :focus-visible { | |
| outline: 2px solid var(--color-primary); | |
| outline-offset: 2px; |
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.
The design system already defines a --color-focus-ring token in tokens.css (lines 86 and 139). To maintain consistency and ensure that focus styles are managed through established design tokens, consider using var(--color-focus-ring) instead of var(--color-primary). If the current value of --color-focus-ring is too subtle, it should be updated in the tokens file to match the desired prominence. Additionally, be aware that a positive outline-offset can cause the focus indicator to be clipped in containers with overflow: hidden; ensure that parent containers have sufficient padding or consider a smaller offset for the global default.
| :focus-visible { | |
| outline: 2px solid var(--color-primary); | |
| outline-offset: 2px; | |
| } | |
| :focus-visible { | |
| outline: 2px solid var(--color-focus-ring); | |
| outline-offset: 2px; | |
| } |
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.
Because
base.cssis imported near the top offrontend/style.css(beforemodal.css,dashboard.css, etc.), later component styles can override this global:focus-visiblerule. For example,frontend/styles/modal.csssets.tooltip-icon { outline: none; }, which will prevent this focus indicator from appearing unless this rule comes later in the cascade or has higher specificity. Consider moving the global focus-visible rule to a later-imported stylesheet (e.g.,utilities.css) or adjusting the selector/specificity so it reliably applies app-wide.