-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[VisuallyHidden] Updating Visually Hidden CSS (#4641)
* modernized visually hidden styles * used gov uk design system styles for visually hidden since they have already been tested
- Loading branch information
1 parent
df8affe
commit 4d692a1
Showing
2 changed files
with
8 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |