little bit more accessible tabs
This commit is contained in:
parent
d013b351e2
commit
98a831961e
|
@ -20,21 +20,17 @@ export default defineComponent({
|
||||||
"pxhvhrfw",
|
"pxhvhrfw",
|
||||||
{ chips: this.style === "chips" },
|
{ chips: this.style === "chips" },
|
||||||
],
|
],
|
||||||
|
role: "tablist",
|
||||||
},
|
},
|
||||||
options.map((option) =>
|
options.map((option) =>
|
||||||
withDirectives(
|
withDirectives(
|
||||||
h(
|
h(
|
||||||
"button",
|
"button",
|
||||||
{
|
{
|
||||||
class: [
|
class: "_button",
|
||||||
"_button",
|
role: "tab",
|
||||||
{
|
|
||||||
active:
|
|
||||||
this.modelValue === option.props?.value,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
key: option.key,
|
key: option.key,
|
||||||
disabled: this.modelValue === option.props?.value,
|
'aria-selected': this.modelValue === option.props?.value ? "true" : "false",
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
this.$emit(
|
this.$emit(
|
||||||
"update:modelValue",
|
"update:modelValue",
|
||||||
|
@ -70,12 +66,12 @@ export default defineComponent({
|
||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.active {
|
&[aria-selected="true"] {
|
||||||
color: var(--accent);
|
color: var(--accent);
|
||||||
background: var(--accentedBg) !important;
|
background: var(--accentedBg) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:not(.active):hover {
|
&:not([aria-selected="true"]):hover {
|
||||||
color: var(--fgHighlighted);
|
color: var(--fgHighlighted);
|
||||||
background: var(--panelHighlight);
|
background: var(--panelHighlight);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue