Skip to content

Commit

Permalink
fix(VisuallyHidden): force properties to overcome unwanted CSS specif…
Browse files Browse the repository at this point in the history
…icity (#2366)
  • Loading branch information
tujoworker committed May 31, 2023
1 parent 541e889 commit ed088de
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ exports[`VisuallyHidden VisuallyHidden scss have to match snapshot 1`] = `
* Utilities
*/
.dnb-visually-hidden--focusable:not(:focus, :focus-within) {
user-select: none;
-webkit-touch-callout: none;
pointer-events: none;
position: absolute;
clip-path: inset(50%);
max-width: 1px;
max-height: 1px;
overflow: hidden;
white-space: nowrap;
padding: 0;
margin: 0;
border: 0;
user-select: none !important;
-webkit-touch-callout: none !important;
pointer-events: none !important;
position: absolute !important;
clip-path: inset(50%) !important;
max-width: 1px !important;
max-height: 1px !important;
overflow: hidden !important;
white-space: nowrap !important;
padding: 0 !important;
margin: 0 !important;
border: 0 !important;
}"
`;
24 changes: 12 additions & 12 deletions packages/dnb-eufemia/src/style/core/utilities.scss
Original file line number Diff line number Diff line change
Expand Up @@ -291,23 +291,23 @@ $breakpoints: (

// Screen reader only helper
@mixin srOnly() {
user-select: none;
-webkit-touch-callout: none; // iOS
pointer-events: none;
user-select: none !important;
-webkit-touch-callout: none !important; // iOS
pointer-events: none !important;

position: absolute;
position: absolute !important;

clip-path: inset(50%);
max-width: 1px; // if less than 1px, Safari moves the focus-ring to another place
max-height: 1px; // if less than 1px, Safari moves the focus-ring to another place
clip-path: inset(50%) !important;
max-width: 1px !important; // if less than 1px, Safari moves the focus-ring to another place
max-height: 1px !important; // if less than 1px, Safari moves the focus-ring to another place

overflow: hidden;
white-space: nowrap; // NB: so NVDA not splits up text in multi line
overflow: hidden !important;
white-space: nowrap !important; // NB: so NVDA not splits up text in multi line

padding: 0;
margin: 0;
padding: 0 !important;
margin: 0 !important;

border: 0;
border: 0 !important;
}

@function str-replace($string, $search, $replace: '') {
Expand Down

0 comments on commit ed088de

Please sign in to comment.