Skip to content

Commit d7f31a1

Browse files
committed
Maybe slightly better labeling for glossary HUDs?
This component is upsetting. Why does it apply `aria-describedby` do a random span? Does the <button> even do anything? :( :( :(
1 parent 95ca271 commit d7f31a1

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

docs/.vuepress/theme/global-components/InfoHud.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="info-hud">
33
<v-popover placement="right" :click="handleClick">
4-
<button>
4+
<button :title="activateLabel">
55
<svg class="info-circle" viewBox="0 0 512 512">
66
<path
77
d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"
@@ -30,6 +30,12 @@ export default {
3030
e.preventDefault();
3131
},
3232
},
33+
props: {
34+
activateLabel: {
35+
type: String,
36+
default: 'Open',
37+
},
38+
},
3339
};
3440
</script>
3541

docs/.vuepress/theme/global-components/Term.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
:title="`${label} in the Glossary`"
1010
v-text="label"></a>
1111

12-
<InfoHud>
12+
<InfoHud :activateLabel="triggerLabel">
1313
<template v-if="loaded">
1414
<h3 class="glossary-term-heading" v-text="this.term.title"></h3>
1515
<div class="glossary-term-content theme-default-content" v-html="this.term.summaryHtml"></div>
@@ -121,7 +121,10 @@ export default {
121121
},
122122
apiUrl() {
123123
return `${CRAFTCOM_BASE_URL}/api/glossary/${this.slug}`;
124-
}
124+
},
125+
triggerLabel() {
126+
return `Open definition for “${this.label}`;
127+
},
125128
},
126129
mounted() {},
127130
data() {

0 commit comments

Comments
 (0)