Skip to content

Commit

Permalink
chore: themes
Browse files Browse the repository at this point in the history
  • Loading branch information
enzonotario committed Dec 3, 2023
1 parent ad8ae65 commit 4cc8a8b
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 39 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"license": "ISC",
"devDependencies": {
"@antfu/eslint-config": "^0.34.2",
"@es-js/docs-components": "^0.0.16",
"@es-js/docs-components": "^0.0.18",
"@es-js/language-tools": "^0.0.15",
"@iconify/vue": "^4.1.1",
"autoprefixer": "^10.4.14",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 6 additions & 20 deletions src/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { createWriteStream } from 'node:fs'
import { resolve } from 'node:path'
import { SitemapStream } from 'sitemap'
import { defineConfigWithTheme } from 'vitepress'
import { getHighlighter } from 'shikiji'
// @ts-expect-error - esjsSyntax is a json file
import esjsSyntax from '@es-js/language-tools/esjs.tmLanguage.json' assert {type: 'json'}
import { metaData } from './constants'
Expand All @@ -19,17 +18,6 @@ export default async () => {
scopeName: 'source.esjs',
}

const highlighter = await getHighlighter({
langs: [
'javascript',
esjsLanguage,
],
themes: [
'vitesse-light',
'vitesse-dark',
],
})

const defaultSidebar = [
{
text: 'Introducción',
Expand Down Expand Up @@ -98,15 +86,13 @@ export default async () => {
title: metaData.title,
description: metaData.description,
markdown: {
highlight: (str: string, lang: string, attrs: string) => {
return highlighter.codeToHtml(str, {
lang,
themes: {
light: 'vitesse-light',
dark: 'vitesse-dark',
},
})
theme: {
light: 'vitesse-light',
dark: 'vitesse-dark',
},
languages: [
esjsLanguage,
],
},
cleanUrls: true,

Expand Down
47 changes: 33 additions & 14 deletions src/.vitepress/theme/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@

/** Background colos */

:root.dark {
--vp-c-brand: #B388FF;
--vp-c-brand-light: #9575CD;
--vp-c-brand-lighter: #B39DDB;
--vp-c-brand-dark: #673AB7;
--vp-c-brand-darker: #5E35B1;
}

:root {
--vp-c-bg: theme('colors.gray.50');
--vp-c-bg-alt: theme('colors.gray.100');
--vp-c-bg-elv: #ffffff;
--vp-c-bg-soft: #f6f6f7;
}

.dark {
--vp-c-bg: theme('colors.gray.900');
--vp-c-bg-alt: theme('colors.gray.900');
--vp-c-bg-elv: #202127;
--vp-c-bg-soft: #202127;
}

/** Text colors */

:root {
Expand All @@ -36,11 +35,12 @@
);
}

.dark {
--vp-c-bg: theme('colors.gray.900');
--vp-c-bg-alt: theme('colors.gray.900');
--vp-c-bg-elv: #202127;
--vp-c-bg-soft: #202127;
:root.dark {
--vp-c-brand: #B388FF;
--vp-c-brand-light: #9575CD;
--vp-c-brand-lighter: #B39DDB;
--vp-c-brand-dark: #673AB7;
--vp-c-brand-darker: #5E35B1;
}

.accent {
Expand Down Expand Up @@ -86,10 +86,29 @@
}

.vp-doc div[class*='language-'] {
@apply rounded-lg border
@apply bg-white
border
rounded-lg;
}
.dark .vp-doc div[class*='language-'] {
@apply bg-[#121212]
border border-gray-700
rounded-lg;
}

/** Content on Home */
.VPContent.is-home {
padding-top: 0 !important;
}

/** InlinePlayground */

.InlinePlayground {
/*@apply rounded-lg*/
}
.InlinePlayground > div > div[class*='language-'] {
@apply rounded-lg border
}
.InlinePlayground .EmbedPlayground iframe {
@apply rounded-lg border dark:border-gray-700
}

0 comments on commit 4cc8a8b

Please sign in to comment.