Skip to content

Commit

Permalink
feat(components): enhance link a11y
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Dec 17, 2023
1 parent b7790ec commit 8d1957b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 32 deletions.
8 changes: 8 additions & 0 deletions packages/components/client/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.k-link {
cursor: pointer;
text-decoration: underline dotted;

&:hover {
text-decoration: underline;
}
}
2 changes: 2 additions & 0 deletions packages/components/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import virtual from './virtual'
import Comment from './k-comment.vue'
import ImageViewer from './image-viewer.vue'

import './index.scss'

export * from 'cosmokit'
export * from './chat'
export * from './form'
Expand Down
8 changes: 8 additions & 0 deletions packages/components/client/k-comment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ const icon = computed(() => {
& + & {
margin-top: -1rem;
}
:deep(a) {
text-decoration: underline dotted;
&:hover {
text-decoration: underline;
}
}
}
</style>
13 changes: 1 addition & 12 deletions plugins/market/client/extensions/dep-link.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<span class="link" @click.stop="active = name">
<span class="k-link" @click.stop="active = name">
{{ name }}
</span>
<span v-if="store.packages[name]?.runtime?.id"> (已加载)</span>
Expand All @@ -17,14 +17,3 @@ defineProps<{
}>()
</script>

<style scoped lang="scss">
.link {
&:hover {
cursor: pointer;
text-decoration: underline;
}
}
</style>
13 changes: 1 addition & 12 deletions plugins/market/client/extensions/missing.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<k-comment type="danger">
<p>此插件尚未安装,<span class="link" @click="gotoMarket">点击前往插件市场</span>。</p>
<p>此插件尚未安装,<span class="k-link" @click="gotoMarket">点击前往插件市场</span>。</p>
</k-comment>
</template>

Expand All @@ -18,14 +18,3 @@ function gotoMarket() {
}
</script>

<style lang="scss" scoped>
.link {
&:hover {
cursor: pointer;
text-decoration: underline;
}
}
</style>
9 changes: 1 addition & 8 deletions plugins/market/client/extensions/version.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<!-- external -->
<k-comment type="warning" v-if="!data.local.workspace && store.dependencies && !store.dependencies[data.name]">
<p>尚未将当前插件列入依赖,<span class="link" @click="send('market/install', { [data.name]: data.local.package.version })">点击添加</span>。</p>
<p>尚未将当前插件列入依赖,<span class="k-link" @click="send('market/install', { [data.name]: data.local.package.version })">点击添加</span>。</p>
</k-comment>
</template>

Expand All @@ -54,13 +54,6 @@ const versions = computed(() => store.registry?.[props.data.name])

<style lang="scss" scoped>
.link {
&:hover {
cursor: pointer;
text-decoration: underline;
}
}
.navigation {
margin-bottom: 2rem;
display: flex;
Expand Down

0 comments on commit 8d1957b

Please sign in to comment.