Use class to style screenreader-only text
This commit is contained in:
parent
6158b8667e
commit
902954b298
14
src/App.scss
14
src/App.scss
@ -580,8 +580,6 @@ textarea,
|
||||
}
|
||||
|
||||
&[type="checkbox"] {
|
||||
display: none;
|
||||
|
||||
&:checked + label::before {
|
||||
color: $fallback--text;
|
||||
color: var(--inputText, $fallback--text);
|
||||
@ -887,3 +885,15 @@ option {
|
||||
opacity: 0;
|
||||
}
|
||||
/* stylelint-enable no-descending-specificity */
|
||||
|
||||
.visible-for-screenreader-only {
|
||||
display: block;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
visibility: visible;
|
||||
clip: rect(0 0 0 0);
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
}
|
||||
|
@ -16,15 +16,3 @@
|
||||
@content;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin visible-for-screenreader-only {
|
||||
display: block;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
visibility: visible;
|
||||
clip: rect(0 0 0 0);
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
class="visible-for-screenreader-only"
|
||||
:disabled="disabled"
|
||||
:checked="modelValue"
|
||||
:indeterminate="indeterminate"
|
||||
@ -85,8 +86,6 @@ export default {
|
||||
}
|
||||
|
||||
input[type="checkbox"] {
|
||||
@include visible-for-screenreader-only;
|
||||
|
||||
&:checked + .checkbox-indicator::before {
|
||||
color: $fallback--text;
|
||||
color: var(--inputText, $fallback--text);
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div
|
||||
class="screen-reader-text"
|
||||
class="visible-for-screenreader-only"
|
||||
:aria-live="ariaLive"
|
||||
>
|
||||
{{ currentText }}
|
||||
@ -8,11 +8,3 @@
|
||||
</template>
|
||||
|
||||
<script src="./screen_reader_notice.js"></script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "../../mixins";
|
||||
|
||||
.screen-reader-text {
|
||||
@include visible-for-screenreader-only;
|
||||
}
|
||||
</style>
|
||||
|
@ -5,12 +5,12 @@
|
||||
>
|
||||
<Popover
|
||||
trigger="hover"
|
||||
:trigger-attrs="{ 'aria-label': $t('settings.setting_changed') }"
|
||||
>
|
||||
<template #trigger>
|
||||
|
||||
<FAIcon
|
||||
icon="wrench"
|
||||
:aria-label="$t('settings.setting_changed')"
|
||||
/>
|
||||
</template>
|
||||
<template #content>
|
||||
|
Loading…
Reference in New Issue
Block a user