-
Notifications
You must be signed in to change notification settings - Fork 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
feat: improve focus outline styles for text/select inputs #1318
Conversation
c0782b6
to
95eb0ff
Compare
Playwright Test Component is ready. |
Preview is ready. |
@Kyzyl-ool Currently I see no difference, is it a bug or there is no default? |
I left outline color empty by default, so yes – there shouldn't be any differences. Outline on focus for inputs and selects are debatable |
95eb0ff
to
48b1bdf
Compare
@Kyzyl-ool Maybe we keep default offset to avoid overlapping with border? Error state not visible at all |
@@ -168,6 +168,7 @@ $blockButton: '.#{variables.$ns}select-control__button'; | |||
|
|||
&_error::before { | |||
border-color: var(--g-color-line-danger); | |||
--g-select-focus-outline-color: var(--g-color-line-danger); |
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.
This wont allow override this variable, we must use private/public pair here
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.
Fixed
@@ -187,6 +189,10 @@ $block: '.#{variables.$ns}text-area'; | |||
&:focus-within { | |||
border-color: var(--g-color-line-danger); | |||
} | |||
|
|||
&:focus-within { | |||
--g-text-area-focus-outline-color: var(--g-color-line-danger); |
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.
Same as above
@@ -380,6 +382,10 @@ $block: '.#{variables.$ns}text-input'; | |||
&:focus-within { | |||
border-color: var(--g-color-line-danger); | |||
} | |||
|
|||
&:focus-within { | |||
--g-text-input-focus-outline-color: var(--g-color-line-danger); |
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.
Same as above
&:focus::before { | ||
outline: 2px solid var(--g-select-focus-outline-color, var(--_--focus-outline-color)); | ||
outline-offset: -1px; | ||
} | ||
&:focus:not(:focus-visible)::before { | ||
outline: 0; | ||
} |
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.
We can now safely use raw :focus-visible
selector
ce7e897
to
1aab151
Compare
1aab151
to
c566f26
Compare
closes #1043