Skip to content

Commit

Permalink
remove off-screen mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
basher committed Nov 8, 2024
1 parent 0a964f2 commit a29faf0
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 32 deletions.
2 changes: 0 additions & 2 deletions ui/src/css/components/_skiplinks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ Dependencies.
----------------------------------------------------------------------------
*/
@use '../base' as *;
@use '../mixins' as *;

.skiplinks {
position: absolute;

&__link {
@include off-screen;
background-color: $color-brand;
color: $color-neutral-100;
display: inline-block;
Expand Down
1 change: 0 additions & 1 deletion ui/src/css/mixins/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
@forward 'button-reset';
@forward 'focus';
@forward 'form-field-reset';
@forward 'off-screen';
24 changes: 0 additions & 24 deletions ui/src/css/mixins/_off-screen.scss

This file was deleted.

10 changes: 8 additions & 2 deletions ui/src/css/utilities/_display.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Dependencies.
----------------------------------------------------------------------------
*/
@use '../mixins' as *;
@use '../base' as *;

/*
Expand All @@ -12,7 +11,14 @@ Visually hide content but make it available to screen readers.
----------------------------------------------------------------------------
*/
.visually-hidden {
@include off-screen;
&:not(:focus):not(:active) {
block-size: 1px;
clip-path: inset(50%);
inline-size: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
}
}

/*
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/5. Components/Skiplinks/Skiplinks.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const SkiplinksHtml = () => `
<nav class="skiplinks" aria-label="skiplinks">
<a class="skiplinks__link" href="#main">Skip to main content</a>
<a class="skiplinks__link visually-hidden" href="#main">Skip to main content</a>
</nav>
<p>Some content preceding skiplink target - Lorem ipsum, dolor sit amet consectetur adipisicing elit. Accusamus, incidunt non numquam deserunt dolorem, perspiciatis error asperiores fuga.</p>
Expand Down
4 changes: 2 additions & 2 deletions ui/stories/8. Pages/Homepage.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ ${style}
<div class="page">
<header class="header">
<nav class="skiplinks" aria-label="skiplinks">
<a class="skiplinks__link" href="#main">Skip to main content</a>
<a class="skiplinks__link" href="#footer">Skip to footer</a>
<a class="skiplinks__link visually-hidden" href="#main">Skip to main content</a>
<a class="skiplinks__link visually-hidden" href="#footer">Skip to footer</a>
</nav>
<div class="wrapper wrapper--l">
Expand Down

0 comments on commit a29faf0

Please sign in to comment.