Skip to content

Commit

Permalink
remove --focus-ring
Browse files Browse the repository at this point in the history
  • Loading branch information
claviska committed Aug 27, 2021
1 parent 719d62b commit f4c472e
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 13 deletions.
4 changes: 2 additions & 2 deletions docs/components/form.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ The `invalid` attribute reflects the form control's validity, so you can style i
border-color: rgb(var(--sl-color-danger-500));
}
.custom-input[invalid] {
--focus-ring: 0 0 0 var(--sl-focus-ring-width) rgb(var(--sl-color-danger-500) / var(--sl-focus-ring-alpha));
.custom-input[invalid]:focus-within::part(base) {
box-shadow: 0 0 0 var(--sl-focus-ring-width) rgb(var(--sl-color-danger-500) / var(--sl-focus-ring-alpha));
}
</style>
```
Expand Down
1 change: 1 addition & 0 deletions docs/resources/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ _During the beta period, these restrictions may be relaxed in the event of a mis

- 🚨 BREAKING: fixed a bug where `--sl-color-neutral-0` and `--sl-color-neutral-1000` were inverted (swap them to update)
- 🚨 BREAKING: removed the `no-fieldset` property from `sl-radio-group` (fieldsets are now hidden by default; use `fieldset` to show them)
- 🚨 BREAKING: removed `--focus-ring` custom property from `sl-input`, `sl-select`, `sl-tab` for consistency with other form controls
- Added `--swatch-size` custom property to `sl-color-picker`
- Added `date` to `sl-input` as a supported `type`
- Added the `--sl-focus-ring` design token for a more convenient way to apply focus ring styles
Expand Down
3 changes: 1 addition & 2 deletions src/components/input/input.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export default css`
${formControlStyles}
:host {
--focus-ring: 0 0 0 var(--sl-focus-ring-width) rgb(var(--sl-color-primary-500) / var(--sl-focus-ring-alpha));
display: block;
}
Expand Down Expand Up @@ -41,7 +40,7 @@ export default css`
.input.input--focused:not(.input--disabled) {
background-color: rgb(var(--sl-input-background-color-focus));
border-color: rgb(var(--sl-input-border-color-focus));
box-shadow: var(--focus-ring);
box-shadow: var(--sl-focus-ring);
}
.input.input--focused:not(.input--disabled) .input__control {
Expand Down
2 changes: 0 additions & 2 deletions src/components/input/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ let id = 0;
* @csspart password-toggle-button - The password toggle button.
* @csspart suffix - The input suffix container.
* @csspart help-text - The input help text.
*
* @cssproperty --focus-ring - The focus ring style to use when the control receives focus, a `box-shadow` property.
*/
@customElement('sl-input')
export default class SlInput extends LitElement {
Expand Down
4 changes: 1 addition & 3 deletions src/components/select/select.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ export default css`
${formControlStyles}
:host {
--focus-ring: var(--sl-focus-ring);
display: block;
}
Expand Down Expand Up @@ -42,7 +40,7 @@ export default css`
.select.select--focused:not(.select--disabled) .select__box {
background-color: rgb(var(--sl-input-background-color-focus));
border-color: rgb(var(--sl-input-border-color-focus));
box-shadow: var(--focus-ring);
box-shadow: var(--sl-focus-ring);
outline: none;
color: rgb(var(--sl-input-color-focus));
}
Expand Down
2 changes: 0 additions & 2 deletions src/components/select/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ let id = 0;
* @csspart menu - The select menu, a <sl-menu> element.
* @csspart tag - The multiselect option, a <sl-tag> element.
* @csspart tags - The container in which multiselect options are rendered.
*
* @cssproperty --focus-ring - The focus ring style to use when the control receives focus, a `box-shadow` property.
*/
@customElement('sl-select')
export default class SlSelect extends LitElement {
Expand Down
2 changes: 0 additions & 2 deletions src/components/tab/tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ let id = 0;
*
* @csspart base - The component's base wrapper.
* @csspart close-button - The close button, which is the icon button's base wrapper.
*
* @cssproperty --focus-ring - The focus ring's box shadow.
*/
@customElement('sl-tab')
export default class SlTab extends LitElement {
Expand Down

0 comments on commit f4c472e

Please sign in to comment.