Skip to content

Commit

Permalink
fix(content): fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Tahul committed Nov 26, 2022
2 parents 8a777eb + 76a0ddc commit 01e6127
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 2 deletions.
38 changes: 38 additions & 0 deletions assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,41 @@ body {
}
}

.docus-scrollbars {
& ::-webkit-scrollbar {
width: 0.6em;
height: 0.6em;
background: transparent;
}

& ::-webkit-scrollbar-track {
background: $dt('colors.gray.100');
}

& ::-webkit-scrollbar-thumb {
border-radius: 0.6em;
background: $dt('colors.gray.300');
&:hover {
background: $dt('colors.gray.400');
}
&:active {
background: $dt('colors.gray.500');
}
}

&.dark {
& ::-webkit-scrollbar-track {
background: $dt('colors.gray.800');
}

& ::-webkit-scrollbar-thumb {
background: $dt('colors.gray.700');
&:hover {
background: $dt('colors.gray.600');
}
&:active {
background: $dt('colors.gray.500');
}
}
}
}
17 changes: 15 additions & 2 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { createResolver } from '@nuxt/kit'
import { createResolver, logger } from '@nuxt/kit'
import { $fetch } from 'ofetch'
import { version } from './package.json'

logger.success(`Using Docus v${version}`)

const { resolve } = createResolver(import.meta.url)

Expand All @@ -19,7 +23,16 @@ export default defineNuxtConfig({
'@nuxtjs/color-mode',
'@nuxt/content',
'@vueuse/nuxt',
resolve('./app/module')
resolve('./app/module'),
(_, nuxt) => {
if (nuxt.options.dev) {
$fetch('https://ungh.unjs.io/repos/nuxt-themes/docus/releases/latest').then(({ release }) => {
if (release.tag !== `v${version}`) {
logger.warn(`A new version of Docus (${release.tag}) is available: https://github.com/nuxt-themes/docus/releases/tag/${release.tag}`)
}
}).catch((_) => {})
}
}
],

css: [
Expand Down
5 changes: 5 additions & 0 deletions plugins/scrollbars.client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default defineNuxtPlugin(() => {
if (navigator && navigator.userAgent && navigator.userAgent.match(/Win[a-z0-9]*;/)) {
document.documentElement.classList.add('docus-scrollbars')
}
})

1 comment on commit 01e6127

@vercel
Copy link

@vercel vercel bot commented on 01e6127 Nov 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.