Use class to style screenreader-only text

このコミットが含まれているのは:
tusooa 2023-02-09 21:35:56 -05:00
コミット 902954b298
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: 7B467EDE43A08224
5個のファイルの変更15行の追加26行の削除

ファイルの表示

@ -580,8 +580,6 @@ textarea,
} }
&[type="checkbox"] { &[type="checkbox"] {
display: none;
&:checked + label::before { &:checked + label::before {
color: $fallback--text; color: $fallback--text;
color: var(--inputText, $fallback--text); color: var(--inputText, $fallback--text);
@ -887,3 +885,15 @@ option {
opacity: 0; opacity: 0;
} }
/* stylelint-enable no-descending-specificity */ /* 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; @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 <input
type="checkbox" type="checkbox"
class="visible-for-screenreader-only"
:disabled="disabled" :disabled="disabled"
:checked="modelValue" :checked="modelValue"
:indeterminate="indeterminate" :indeterminate="indeterminate"
@ -85,8 +86,6 @@ export default {
} }
input[type="checkbox"] { input[type="checkbox"] {
@include visible-for-screenreader-only;
&:checked + .checkbox-indicator::before { &:checked + .checkbox-indicator::before {
color: $fallback--text; color: $fallback--text;
color: var(--inputText, $fallback--text); color: var(--inputText, $fallback--text);

ファイルの表示

@ -1,6 +1,6 @@
<template> <template>
<div <div
class="screen-reader-text" class="visible-for-screenreader-only"
:aria-live="ariaLive" :aria-live="ariaLive"
> >
{{ currentText }} {{ currentText }}
@ -8,11 +8,3 @@
</template> </template>
<script src="./screen_reader_notice.js"></script> <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 <Popover
trigger="hover" trigger="hover"
:trigger-attrs="{ 'aria-label': $t('settings.setting_changed') }"
> >
<template #trigger> <template #trigger>
&nbsp; &nbsp;
<FAIcon <FAIcon
icon="wrench" icon="wrench"
:aria-label="$t('settings.setting_changed')"
/> />
</template> </template>
<template #content> <template #content>