docs: enable global theme on every page

This commit is contained in:
zernonia 2023-11-11 01:04:52 +08:00
parent ad5b25d3bc
commit 60d22c8206
7 changed files with 25 additions and 10 deletions

View File

@ -120,6 +120,16 @@ export const docsConfig: DocsConfig = {
},
],
},
{
title: 'Charts',
items: [
{
title: 'Area',
href: '/docs/charts/area',
items: [],
},
],
},
{
title: 'Components',
items: [

View File

@ -128,7 +128,7 @@
}
div[class^="language-"] {
@apply mb-4 mt-6 max-h-[650px] overflow-x-auto md:rounded-lg border !bg-zinc-950 dark:!bg-zinc-900
@apply mb-4 mt-6 max-h-[650px] overflow-x-auto md:rounded-lg border !bg-secondary-foreground dark:!bg-secondary
}
pre {
@apply py-4;

View File

@ -344,14 +344,14 @@
}
.vp-doc [class*='language-'] code .highlighted {
background-color: hsl(240 3.7% 15.9%);
transition: background-color 0.5s;
/* margin: 0 -24px;
padding: 0 24px; */
width: calc(100% + 2 * 24px);
display: inline-block;
@apply bg-[hsl(var(--foreground))] dark:bg-[hsl(var(--background)_/_50%)]
}
hsl(var(--foreground) / 50%)
.vp-doc [class*='language-'] code .highlighted.error {
background-color: var(--vp-code-line-error-color);
}

View File

@ -22,7 +22,7 @@ description: How to install dependencies and structure your app.
<LinkedCard href="/docs/installation/nuxt">
<svg xmlns="http://www.w3.org/2000/svg" class="w-12 h-12" viewBox="0 0 900 900" fill="none">
<title>Nuxt</title>
<path d="M504.908 750H839.476C850.103 750.001 860.542 747.229 869.745 741.963C878.948 736.696 886.589 729.121 891.9 719.999C897.211 710.876 900.005 700.529 900 689.997C899.995 679.465 897.193 669.12 891.873 660.002L667.187 274.289C661.876 265.169 654.237 257.595 645.036 252.329C635.835 247.064 625.398 244.291 614.773 244.291C604.149 244.291 593.711 247.064 584.511 252.329C575.31 257.595 567.67 265.169 562.36 274.289L504.908 372.979L392.581 179.993C387.266 170.874 379.623 163.301 370.42 158.036C361.216 152.772 350.777 150 340.151 150C329.525 150 319.086 152.772 309.883 158.036C300.679 163.301 293.036 170.874 287.721 179.993L8.12649 660.002C2.80743 669.12 0.00462935 679.465 5.72978e-06 689.997C-0.00461789 700.529 2.78909 710.876 8.10015 719.999C13.4112 729.121 21.0523 736.696 30.255 741.963C39.4576 747.229 49.8973 750.001 60.524 750H270.538C353.748 750 415.112 713.775 457.336 643.101L559.849 467.145L614.757 372.979L779.547 655.834H559.849L504.908 750ZM267.114 655.737L120.551 655.704L340.249 278.586L449.87 467.145L376.474 593.175C348.433 639.03 316.577 655.737 267.114 655.737Z" fill="white"/>
<path d="M504.908 750H839.476C850.103 750.001 860.542 747.229 869.745 741.963C878.948 736.696 886.589 729.121 891.9 719.999C897.211 710.876 900.005 700.529 900 689.997C899.995 679.465 897.193 669.12 891.873 660.002L667.187 274.289C661.876 265.169 654.237 257.595 645.036 252.329C635.835 247.064 625.398 244.291 614.773 244.291C604.149 244.291 593.711 247.064 584.511 252.329C575.31 257.595 567.67 265.169 562.36 274.289L504.908 372.979L392.581 179.993C387.266 170.874 379.623 163.301 370.42 158.036C361.216 152.772 350.777 150 340.151 150C329.525 150 319.086 152.772 309.883 158.036C300.679 163.301 293.036 170.874 287.721 179.993L8.12649 660.002C2.80743 669.12 0.00462935 679.465 5.72978e-06 689.997C-0.00461789 700.529 2.78909 710.876 8.10015 719.999C13.4112 729.121 21.0523 736.696 30.255 741.963C39.4576 747.229 49.8973 750.001 60.524 750H270.538C353.748 750 415.112 713.775 457.336 643.101L559.849 467.145L614.757 372.979L779.547 655.834H559.849L504.908 750ZM267.114 655.737L120.551 655.704L340.249 278.586L449.87 467.145L376.474 593.175C348.433 639.03 316.577 655.737 267.114 655.737Z" fill="currentColor"/>
</svg>
<p class="mt-2 font-medium">Nuxt</p>
</LinkedCard>

View File

@ -14,7 +14,7 @@ You can choose between using CSS variables or Tailwind CSS utility classes for t
To use utility classes for theming set `tailwind.cssVariables` to `false` in your `components.json` file.
```json {8} title="components.json"
```json {7} title="components.json"
{
"style": "default",
"tailwind": {
@ -39,7 +39,7 @@ To use utility classes for theming set `tailwind.cssVariables` to `false` in you
To use CSS variables for theming set `tailwind.cssVariables` to `true` in your `components.json` file.
```json {8} title="components.json"
```json {7} title="components.json"
{
"style": "default",
"tailwind": {

View File

@ -1,5 +1,5 @@
<script setup lang="ts">
import { VisArea, VisAxis, VisXYContainer } from '@unovis/vue'
import { VisArea, VisAxis, VisLine, VisXYContainer } from '@unovis/vue'
import { Area } from '@unovis/ts'
type Data = typeof data[number]
@ -24,7 +24,7 @@ const data = [
<svg width="0" height="0">
<defs>
<linearGradient id="colorUv" x1="0" y1="0" x2="0" y2="1">
<stop offset="5%" stop-color="hsl(var(--primary))" stop-opacity="0.8" />
<stop offset="5%" stop-color="hsl(var(--primary))" stop-opacity="0.6" />
<stop offset="95%" stop-color="hsl(var(--primary))" stop-opacity="0" />
</linearGradient>
</defs>
@ -42,6 +42,11 @@ const data = [
:rounded-corners="4"
:bar-padding="0.15"
/>
<VisLine
:x="(d: Data, i: number) => i"
:y="(d: Data) => d.total"
color="hsl(var(--primary))"
/>
<VisAxis
type="x"
:num-ticks="data.length"

View File

@ -1,5 +1,5 @@
import { computed } from 'vue'
import { useSessionStorage } from '@vueuse/core'
import { useStorage } from '@vueuse/core'
import { useData } from 'vitepress'
import { type Theme, themes } from './../lib/registry/themes'
import { type Style, styles } from '@/lib/registry/styles'
@ -14,7 +14,7 @@ export const RADII = [0, 0.25, 0.5, 0.75, 1]
export function useConfigStore() {
const { isDark } = useData()
const config = useSessionStorage<Config>('config', {
const config = useStorage<Config>('config', {
theme: 'zinc',
radius: 0.5,
style: styles[0].name,