]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Cleanup/fix after the sr-only to visually-hidden renaming (#31359)
authorPatrick H. Lauke <redux@splintered.co.uk>
Fri, 31 Jul 2020 09:27:36 +0000 (10:27 +0100)
committerGitHub <noreply@github.com>
Fri, 31 Jul 2020 09:27:36 +0000 (10:27 +0100)
* sr-only -> visually-hidden cleanup

It seems the old screen-readers.md file was left behind, and forgot to rename the mixin

* Fix broken mixins for visually-hidden

scss/_mixins.scss
scss/mixins/_visually-hidden.scss [moved from scss/mixins/_screen-reader.scss with 83% similarity]
site/content/docs/5.0/helpers/screen-readers.md [deleted file]

index 8c00f31d25286db49142af9d717b727f0045d1b7..7b06cd8198c91728e1c7ef824658d1fc501d9b6f 100644 (file)
@@ -12,7 +12,7 @@
 @import "mixins/breakpoints";
 @import "mixins/image";
 @import "mixins/resize";
-@import "mixins/screen-reader";
+@import "mixins/visually-hidden";
 @import "mixins/reset-text";
 @import "mixins/text-truncate";
 
similarity index 83%
rename from scss/mixins/_screen-reader.scss
rename to scss/mixins/_visually-hidden.scss
index e5ee63c0949e543f1ba527a01c12807d3660e63e..26edfe84be2fe8b062cc0962f332a42c082301e5 100644 (file)
@@ -1,11 +1,11 @@
 // stylelint-disable declaration-no-important
 
-// Only display content to screen readers
+// Hide content visually while keeping it accessible to assistive technologies
 //
 // See: https://a11yproject.com/posts/how-to-hide-content/
 // See: https://hugogiraudel.com/2016/10/13/css-hide-and-seek/
 
-@mixin visually-hidden {
+@mixin visually-hidden() {
   position: absolute !important;
   width: 1px !important;
   height: 1px !important;
@@ -21,7 +21,7 @@
 //
 // Useful for "Skip to main content" links; see https://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1
 
-@mixin visually-hidden-focusable {
+@mixin visually-hidden-focusable() {
   &:not(:focus) {
     @include visually-hidden();
   }
diff --git a/site/content/docs/5.0/helpers/screen-readers.md b/site/content/docs/5.0/helpers/screen-readers.md
deleted file mode 100644 (file)
index fd9ca88..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
----
-layout: docs
-title: Screen readers
-description: Use screen reader utilities to hide elements on all devices except screen readers.
-group: helpers
----
-
-Hide an element to all devices **except screen readers** with `.visually-hidden`. Use `.visually-hidden-focusable` to show the element only when it's focused (e.g. by a keyboard-only user). Can also be used as mixins.
-
-{{< example >}}
-<h2 class="visually-hidden">Title for screen readers</h2>
-<a class="visually-hidden-focusable" href="#content">Skip to main content</a>
-{{< /example >}}
-
-{{< highlight scss >}}
-// Usage as a mixin
-
-.visually-hidden-title {
-  @include visually-hidden;
-}
-
-.skip-navigation {
-  @include visually-hidden-focusable;
-}
-{{< /highlight >}}