Skip to content
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

[VisuallyHidden] Updating Visually Hidden CSS #4641

Merged
merged 5 commits into from
Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
sophschneider marked this conversation as resolved.
Show resolved Hide resolved
}