Skip to content

Commit

Permalink
[VisuallyHidden] Updating Visually Hidden CSS (#4641)
Browse files Browse the repository at this point in the history
* modernized visually hidden styles

* used gov uk design system styles for visually hidden since they have already been tested
  • Loading branch information
sophschneider authored Nov 16, 2021
1 parent df8affe commit 4d692a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Use [the changelog guidelines](/documentation/Versioning%20and%20changelog.md) t

### Enhancements

- Update `VisuallyHidden` styles to not use `top` or `clip` ([#4641](https://github.com/Shopify/polaris-react/pull/4641)).
- Added `PlainAction` type to `ComplexAction`. ([#4489](https://github.com/Shopify/polaris-react/pull/4489)

### Bug fixes
Expand Down
11 changes: 7 additions & 4 deletions src/styles/shared/_accessibility.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
/// Used to hide an element visually, but keeping it accessible for
/// accessibility tools.

/// styles referenced from GOV.UK design system
/// https://github.com/h5bp/main.css/issues/12#issuecomment-451965809
@mixin visually-hidden {
// Need to make sure we override any existing styles.
// stylelint-disable declaration-no-important
position: absolute !important;
top: 0;
clip: rect(1px, 1px, 1px, 1px) !important;
overflow: hidden !important;
height: 1px !important;
width: 1px !important;
height: 1px !important;
margin: 0 !important;
padding: 0 !important;
overflow: hidden !important;
clip-path: inset(50%) !important;
border: 0 !important;
white-space: nowrap !important;
// stylelint-enable declaration-no-important
}

0 comments on commit 4d692a1

Please sign in to comment.