From: Eduardo San Martin Morote Date: Tue, 9 Mar 2021 10:22:22 +0000 (+0100) Subject: docs: colors for code with theme X-Git-Tag: v2.0.0-alpha.8~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a5d2b268007ab18a02039246069576dadaa2f9e4;p=thirdparty%2Fvuejs%2Fpinia.git docs: colors for code with theme --- diff --git a/docs/.vitepress/theme/code-theme.css b/docs/.vitepress/theme/code-theme.css new file mode 100644 index 00000000..391a36f5 --- /dev/null +++ b/docs/.vitepress/theme/code-theme.css @@ -0,0 +1,302 @@ +[class*='language-'] code { + color: inherit; +} + +code[class*='language-'], +pre[class*='language-'] { + color: #d6deeb; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +pre[class*='language-']::-moz-selection, +pre[class*='language-'] ::-moz-selection, +code[class*='language-']::-moz-selection, +code[class*='language-'] ::-moz-selection { + text-shadow: none; + background: rgba(29, 59, 83, 0.99); +} + +pre[class*='language-']::selection, +pre[class*='language-'] ::selection, +code[class*='language-']::selection, +code[class*='language-'] ::selection { + text-shadow: none; + background: rgba(29, 59, 83, 0.99); +} + +@media print { + code[class*='language-'], + pre[class*='language-'] { + text-shadow: none; + } +} + +/* Code blocks */ +pre[class*='language-'] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; +} + +:not(pre) > code[class*='language-'], +pre[class*='language-'] { + color: white; + background: #011627; +} + +:not(pre) > code[class*='language-'] { + padding: 0.1em; + border-radius: 0.3em; + white-space: normal; +} + +.token.comment, +.token.prolog, +.token.cdata { + color: rgb(99, 119, 119); + font-style: italic; +} + +.token.punctuation { + color: rgb(199, 146, 234); +} + +.namespace { + color: rgb(178, 204, 214); +} + +.token.deleted { + color: rgba(239, 83, 80, 0.56); + font-style: italic; +} + +.token.symbol, +.token.property { + color: rgb(128, 203, 196); +} + +.token.tag, +.token.operator, +.token.keyword { + color: rgb(127, 219, 202); +} + +.token.boolean { + color: rgb(255, 88, 116); +} + +.token.number { + color: rgb(247, 140, 108); +} + +.token.constant, +.token.function, +.token.builtin, +.token.char { + color: rgb(130, 170, 255); +} + +.token.selector, +.token.doctype { + color: rgb(199, 146, 234); + font-style: italic; +} + +.token.attr-name, +.token.inserted { + color: rgb(173, 219, 103); + font-style: italic; +} + +.token.string, +.token.url, +.token.entity, +.language-css .token.string, +.style .token.string { + color: rgb(173, 219, 103); +} + +.token.class-name, +.token.atrule, +.token.attr-value { + color: rgb(255, 203, 139); +} + +.token.regex, +.token.important, +.token.variable { + color: rgb(214, 222, 235); +} + +.token.important, +.token.bold { + font-weight: bold; +} + +.token.italic { + font-style: italic; +} + +/* LIGHT THEME */ + +html.light code[class*='language-'], +html.light pre[class*='language-'] { + color: #403f53; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +html.light pre[class*='language-']::-moz-selection, +html.light pre[class*='language-'] ::-moz-selection, +html.light code[class*='language-']::-moz-selection, +html.light code[class*='language-'] ::-moz-selection { + text-shadow: none; + background: #fbfbfb; +} + +html.light pre[class*='language-']::selection, +html.light pre[class*='language-'] ::selection, +html.light code[class*='language-']::selection, +html.light code[class*='language-'] ::selection { + text-shadow: none; + background: #fbfbfb; +} + +@media print { + html.light code[class*='language-'], + html.light pre[class*='language-'] { + text-shadow: none; + } +} + +/* Code blocks */ +html.light pre[class*='language-'] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; +} + +html.light :not(pre) > code[class*='language-'], +html.light pre[class*='language-'] { + color: white; + background: #fbfbfb; +} + +html.light :not(pre) > code[class*='language-'] { + padding: 0.1em; + border-radius: 0.3em; + white-space: normal; +} + +html.light .token.comment, +html.light .token.prolog, +html.light .token.cdata { + color: rgb(152, 159, 177); + font-style: italic; +} + +html.light .token.punctuation { + color: rgb(153, 76, 195); +} + +html.light .namespace { + color: rgb(12, 150, 155); +} + +html.light .token.deleted { + color: rgba(239, 83, 80, 0.56); + font-style: italic; +} + +html.light .token.symbol, +html.light .token.operator, +html.light .token.keyword, +html.light .token.property { + color: rgb(12, 150, 155); +} + +html.light .token.tag { + color: rgb(153, 76, 195); +} + +html.light .token.boolean { + color: rgb(188, 84, 84); +} + +html.light .token.number { + color: rgb(170, 9, 130); +} + +html.light .token.constant, +html.light .token.builtin, +html.light .token.string, +html.light .token.url, +html.light .token.entity, +html.light .language-css .token.string, +html.light .style .token.string, +html.light .token.char { + color: rgb(72, 118, 214); +} + +html.light .token.selector, +html.light .token.function, +html.light .token.doctype { + color: rgb(153, 76, 195); + font-style: italic; +} + +html.light .token.attr-name, +html.light .token.inserted { + color: rgb(72, 118, 214); + font-style: italic; +} + +html.light .token.class-name, +html.light .token.atrule, +html.light .token.attr-value { + color: rgb(17, 17, 17); +} + +html.light .token.regex, +html.light .token.important, +html.light .token.variable { + color: rgb(201, 103, 101); +} + +html.light .token.important, +html.light .token.bold { + font-weight: bold; +} + +html.light .token.italic { + font-style: italic; +} diff --git a/docs/.vitepress/theme/custom.css b/docs/.vitepress/theme/custom.css index 07bf4904..f8aabd9f 100644 --- a/docs/.vitepress/theme/custom.css +++ b/docs/.vitepress/theme/custom.css @@ -61,11 +61,14 @@ --c-yellow: #ffd859; --c-yellow-light: #f7d336; --c-white-dark: #f8f8f8; + /* #f9fafb */ - --c-brand: #dc9768; - --c-brand-light: #a9683d; + --c-brand: #086367; + --c-brand-light: #33898d; --c-brand-text: var(--c-text-light-1); --c-bg-accent: var(--c-white-dark); + --code-bg-color: var(--c-white-dark); + --code-inline-bg-color: var(--c-white-dark); } .custom-block.tip { @@ -101,6 +104,8 @@ html:not(.light):root { --c-divider: var(--c-divider-dark); --c-bg: var(--c-black); --c-bg-accent: var(--c-black-light); + --code-bg-color: var(--c-black-light); + --code-inline-bg-color: var(--c-black-light); } body, diff --git a/docs/.vitepress/theme/index.js b/docs/.vitepress/theme/index.js index 2dc97478..6c435a67 100644 --- a/docs/.vitepress/theme/index.js +++ b/docs/.vitepress/theme/index.js @@ -1,5 +1,6 @@ import Theme from 'vitepress/theme' import './custom.css' +import './code-theme.css' export default { ...Theme,