Skip to content

Commit

Permalink
fix(14063): fix some components focused states (#98)
Browse files Browse the repository at this point in the history
* fix(14063): fix some components focused states

---------

Co-authored-by: Natallia Harshunova <[email protected]>
  • Loading branch information
Natallia-Harshunova and nattallius authored Aug 29, 2024
1 parent 5c7c909 commit f89fef0
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
6 changes: 5 additions & 1 deletion packages/default-theme/typography.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ select,
button,
a {
&:focus {
outline-color: var(--complimentary-strong);
outline: none;
box-shadow: none;
}
&:focus-visible {
outline: 2px solid var(--complimentary-strong);
}
}

Expand Down
3 changes: 2 additions & 1 deletion packages/ui-kit/src/Checkbox/style.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
}
}

&:focus {
&:focus-visible {
box-shadow: 0px 0px 0px 2px var(--complimentary-strong-down);
outline: none;
}

&:disabled {
Expand Down
4 changes: 2 additions & 2 deletions packages/ui-kit/src/Radio/Radio.fixture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export default {
return (
<div style={{ display: 'flex', flexFlow: 'column nowrap' }}>
<Radio id="one" label="Foo" value="foo" checked={state === 'foo'} onChange={onChange('foo')} />
<Radio id="two" label="Bar" value="bar" checked={state === 'bar'} onChange={onChange('two')} />
<Radio id="three" label="Baz" value="baz" checked={state === 'baz'} onChange={onChange('three')} />
<Radio id="two" label="Bar" value="bar" checked={state === 'bar'} onChange={onChange('bar')} />
<Radio id="three" label="Baz" value="baz" checked={state === 'baz'} onChange={onChange('baz')} />
<code style={{ whiteSpace: 'pre', marginTop: '1em' }}>{JSON.stringify(state, null, 2)}</code>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions packages/ui-kit/src/Radio/style.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
width: var(--double-unit);
height: var(--double-unit);
border-radius: 50%;
outline: none;
margin: 0;
cursor: pointer;
margin-right: var(--unit);
Expand All @@ -31,8 +30,9 @@
border-color: var(--base-strong);
}

&:focus {
&:focus-visible {
box-shadow: 0px 0px 0px 2px var(--complimentary-strong-down);
outline: none;
}

&:disabled {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,8 @@
background-color: var(--base-weak-up);
}

&:focus-within,
&:active,
&:focus {
&:has(:focus),
&:focus-visible {
box-shadow: 0 0 0 2px var(--complimentary-strong-down);
background-color: var(--base-weak-up);
}
Expand Down Expand Up @@ -162,8 +161,8 @@
}
}

& button:focus .placeholder,
& button:focus .alwaysShowPlaceholder .placeholder {
& button:focus-visible .placeholder,
& button:focus-visible .alwaysShowPlaceholder .placeholder {
color: var(--complimentary-strong-down);
}
}
2 changes: 1 addition & 1 deletion packages/ui-kit/src/Toggler/style.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
}
}
:focus ~ .toggle {
:focus-visible ~ .toggle {
box-shadow: 0px 0px 0px 2px var(--complimentary-strong-down);
}
}
Expand Down

0 comments on commit f89fef0

Please sign in to comment.