Update `.sr-only` mixin and utility (#25197)

* Remove clip-path from .sr-only utility as it causes perf regressions in Chrome

* change snippet to example
This commit is contained in:
Mark Otto 2018-02-11 15:05:50 -08:00 committed by GitHub
parent e373fbea92
commit 98111214c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -12,9 +12,9 @@ Hide an element to all devices **except screen readers** with `.sr-only`. Combin
Necessary for following [accessibility best practices]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/#accessibility).
{%- endcomment -%}
{% highlight html %}
{% example html %}
<a class="sr-only sr-only-focusable" href="#content">Skip to main content</a>
{% endhighlight %}
{% endexample %}
{% highlight scss %}
// Usage as a mixin

View File

@ -11,7 +11,6 @@
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
clip-path: inset(50%);
border: 0;
}
@ -30,6 +29,5 @@
overflow: visible;
clip: auto;
white-space: normal;
clip-path: none;
}
}