Skip to content

Commit

Permalink
fix(actionbutton, closebutton, picker): remove !important declarations
Browse files Browse the repository at this point in the history
This removes the `!important` declarations that were placed upon `box-shadow`s to forcefully remove focus rings. Using `!important` was causing problems for folks who were trying to customize the focus rings, especially in a Windows High Contrast Mode context.
  • Loading branch information
pfulton committed Jun 29, 2022
1 parent 68b7516 commit a26c212
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion components/actionbutton/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ a.spectrum-ActionButton {
}

&:focus-ring {
box-shadow: none !important;
/* kill the default ring */
box-shadow: none;

&:after {
box-shadow: 0 0 0 var(--mod-actionbutton-focus-ring-thickness, var(--spectrum-actionbutton-focus-ring-thickness)) var(--highcontrast-actionbutton-focus-ring-color, var(--mod-actionbutton-focus-ring-color, var(--spectrum-actionbutton-focus-ring-color)));
Expand Down
2 changes: 1 addition & 1 deletion components/closebutton/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ a.spectrum-CloseButton {

&:focus-ring {
/* kill the default ring */
box-shadow: none !important;
box-shadow: none;

&:after {
box-shadow: 0 0 0 var(--spectrum-closebutton-focus-ring-size) var(--spectrum-closebutton-focus-ring-color);
Expand Down
2 changes: 1 addition & 1 deletion components/picker/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ governing permissions and limitations under the License.

&:focus-ring {
/* kill the default ring */
box-shadow: none !important;
box-shadow: none;

&:after {
box-shadow: 0 0 0 var(--spectrum-picker-focus-ring-size) var(--spectrum-picker-focus-ring-color);
Expand Down

0 comments on commit a26c212

Please sign in to comment.