mirror of
https://github.com/fmhy/edit.git
synced 2026-01-12 15:01:06 +11:00
Added Toggle Indexes (#4544)
* Add monochrome theme with grayscale filter * Add indexes toggle and disable starred * Keep filters mutually exclusive
This commit is contained in:
parent
a34a97eb41
commit
361e48f862
5 changed files with 87 additions and 13 deletions
23
docs/.vitepress/theme/components/ToggleIndexes.vue
Normal file
23
docs/.vitepress/theme/components/ToggleIndexes.vue
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<script setup lang="ts">
|
||||
import Switch from './Switch.vue'
|
||||
|
||||
const toggleIndexes = () => {
|
||||
const root = document.documentElement
|
||||
const enabling = !root.classList.contains('indexes-only')
|
||||
root.classList.toggle('indexes-only')
|
||||
|
||||
if (enabling && root.classList.contains('starred-only')) {
|
||||
root.classList.remove('starred-only')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Switch @click="toggleIndexes()" />
|
||||
</template>
|
||||
|
||||
<style>
|
||||
.indexes-only li:not(.index) {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
Loading…
Add table
Add a link
Reference in a new issue