/* ==UserStyle== @name docs.rs Catppuccin @namespace github.com/catppuccin/userstyles/styles/docs.rs @homepageURL https://github.com/catppuccin/userstyles/tree/main/styles/docs.rs @version 2024.12.31 @updateURL https://github.com/keonly/userstyles/raw/main/styles/docs.rs/catppuccin.user.less @supportURL https://github.com/catppuccin/userstyles/issues?q=is%3Aopen+is%3Aissue+label%3Adocs.rs @description Soothing pastel theme for docs.rs @author Catppuccin @license MIT @preprocessor less @var select lightFlavor "Light Flavor" ["latte:Latte", "frappe:Frappé", "macchiato:Macchiato", "mocha:Mocha*"] @var select darkFlavor "Dark Flavor" ["latte:Latte", "frappe:Frappé", "macchiato:Macchiato", "mocha:Mocha*"] @var select accentColor "Accent" ["rosewater:Rosewater", "flamingo:Flamingo", "pink:Pink", "mauve:Mauve", "red:Red", "maroon:Maroon", "peach:Peach", "yellow:Yellow", "green:Green", "teal:Teal", "blue:Blue", "sapphire:Sapphire", "sky:Sky", "lavender:Lavender", "subtext0:Gray*"] ==/UserStyle== */ @-moz-document domain("docs.rs"), domain("doc.rust-lang.org") { :root:not([data-docs-rs-theme]) { @media (prefers-color-scheme: light) { #catppuccin(@lightFlavor); } @media (prefers-color-scheme: dark) { #catppuccin(@darkFlavor); } } :root[data-docs-rs-theme="dark"] { #catppuccin(@darkFlavor); } :root[data-docs-rs-theme="light"] { #catppuccin(@lightFlavor); } #catppuccin(@flavor) { @rosewater: @catppuccin[@@flavor][@rosewater]; @flamingo: @catppuccin[@@flavor][@flamingo]; @pink: @catppuccin[@@flavor][@pink]; @mauve: @catppuccin[@@flavor][@mauve]; @red: @catppuccin[@@flavor][@red]; @maroon: @catppuccin[@@flavor][@maroon]; @peach: @catppuccin[@@flavor][@peach]; @yellow: @catppuccin[@@flavor][@yellow]; @green: @catppuccin[@@flavor][@green]; @teal: @catppuccin[@@flavor][@teal]; @sky: @catppuccin[@@flavor][@sky]; @sapphire: @catppuccin[@@flavor][@sapphire]; @blue: @catppuccin[@@flavor][@blue]; @lavender: @catppuccin[@@flavor][@lavender]; @text: @catppuccin[@@flavor][@text]; @subtext1: @catppuccin[@@flavor][@subtext1]; @subtext0: @catppuccin[@@flavor][@subtext0]; @overlay2: @catppuccin[@@flavor][@overlay2]; @overlay1: @catppuccin[@@flavor][@overlay1]; @overlay0: @catppuccin[@@flavor][@overlay0]; @surface2: @catppuccin[@@flavor][@surface2]; @surface1: @catppuccin[@@flavor][@surface1]; @surface0: @catppuccin[@@flavor][@surface0]; @base: @catppuccin[@@flavor][@base]; @mantle: @catppuccin[@@flavor][@mantle]; @crust: @catppuccin[@@flavor][@crust]; @accent: @catppuccin[@@flavor][@@accentColor]; color-scheme: if(@flavor = latte, light, dark); ::selection { background-color: fade(@accent, 30%); } input, textarea { &::placeholder { color: @subtext0 !important; } } --color-background-code: @mantle; --color-background: @base; --input-color: @text; --input-box-shadow-focus: 0 0 8px 4px @accent; --color-border-light: @surface2; --color-border: @surface0; --color-doc-link-background: @accent; --color-doc-link-hover: @accent; --color-error-hover: red; --color-error: red; --color-macro: red; --color-menu-border: red; --color-menu-header-background: red; --color-navbar-standard: @text; --color-standard: @subtext1; --color-brand: @text; --color-struct: red; --color-type: @peach; --color-url: @accent; --color-warn-background: @peach; --color-warn-msg: @crust; --color-warn-hover: red; --color-warn: @peach; --color-background-input: @mantle; --color-table-header-background: @surface0; --color-table-header: @text; --color-search-focus: red; --chart-title-color: red; --chart-grid: red; --main-background-color: @base; --main-color: @text; --settings-input-color: @accent; --settings-input-border-color: @surface0; --settings-button-color: @text; --settings-button-border-focus: @accent; --sidebar-background-color: @mantle; --sidebar-background-color-hover: @crust; --source-sidebar-background-selected: @surface0; --source-sidebar-background-hover: @base; --code-block-background-color: @mantle; --headings-border-bottom-color: @overlay1; --border-color: @surface0; --button-background-color: @mantle; --right-side-color: @surface2; --code-attribute-color: @yellow; --toggles-color: @subtext1; --search-input-focused-border-color: @accent; --copy-path-button-color: @text; --codeblock-error-hover-color: @red; --codeblock-error-color: fade(@red, 70%); --codeblock-ignore-hover-color: @red; --codeblock-ignore-color: fade(@red, 70%); --warning-border-color: red; --type-link-color: @sky; --trait-link-color: @mauve; --assoc-item-link-color: @yellow; --function-link-color: @green; --macro-link-color: @green; --keyword-link-color: @yellow; --mod-link-color: @accent; --link-color: @accent; --sidebar-link-color: @accent; --sidebar-current-link-background-color: @surface0; --search-result-link-focus-background-color: fade(@accent, 20%); --search-result-border-color: @surface0; --search-color: @text; --search-error-code-background-color: red; --search-results-alias-color: red; --search-results-grey-color: @subtext1; --search-tab-title-count-color: @subtext0; --search-tab-button-not-selected-border-top-color: @crust; --search-tab-button-not-selected-background: @crust; --search-tab-button-selected-border-top-color: @accent; --search-tab-button-selected-background: @base; --stab-background-color: @surface0; --stab-code-color: @accent; --code-highlight-kw-color: @mauve; --code-highlight-kw-2-color: @mauve; --code-highlight-lifetime-color: @blue; --code-highlight-prelude-color: @yellow; --code-highlight-prelude-val-color: @yellow; --code-highlight-number-color: @peach; --code-highlight-string-color: @green; --code-highlight-literal-color: @red; --code-highlight-attribute-color: @yellow; --code-highlight-self-color: @red; --code-highlight-macro-color: @blue; --code-highlight-question-mark-color: @teal; --code-highlight-comment-color: @overlay2; --code-highlight-doc-comment-color: @overlay2; --color-syntax-foreground: inherit; --color-syntax-attribute: @yellow; --color-syntax-background: @mantle; --color-syntax-bool: @red; --color-syntax-comment: @overlay2; --color-syntax-doc-comment: @overlay2; --color-syntax-keyword1: @mauve; --color-syntax-keyword2: @mauve; --color-syntax-lifetime: @blue; --color-syntax-macro: @blue; --color-syntax-number: @peach; --color-syntax-prelude-ty: @yellow; --color-syntax-prelude-val: @yellow; --color-syntax-question-mark: @teal; --color-syntax-self: @red; --color-syntax-string: @green; --src-line-numbers-span-color: @accent; --src-line-number-highlighted-background-color: fade(@accent, 30%); --test-arrow-color: #dedede; --test-arrow-background-color: red; --test-arrow-hover-color: #dedede; --test-arrow-hover-background-color: red; --target-background-color: fade(@accent, 10%); --target-border-color: @accent; --kbd-color: @text; --kbd-background: @mantle; --kbd-box-shadow-color: @surface1; --crate-search-hover-border: red; --src-sidebar-background-selected: @surface0; --src-sidebar-background-hover: @surface1; --table-alt-row-background-color: @mantle; --codeblock-link-background: fade(@surface0, 50%); --scrape-example-toggle-line-background: red; --scrape-example-toggle-line-hover-background: red; --scrape-example-code-line-highlight: fade(@accent, 40%); --scrape-example-code-line-highlight-focus: fade(@accent, 40%); --scrape-example-help-border-color: @subtext0; --scrape-example-help-color: @subtext1; --scrape-example-help-hover-border-color: @text; --scrape-example-help-hover-color: @text; --scrape-example-code-wrapper-background-start: @base; --scrape-example-code-wrapper-background-end: @base; --sidebar-resizer-hover: @sky; --sidebar-resizer-active: @sapphire; select { background-color: @mantle; border-color: @surface0; } hr { border-color: @overlay1; } .rust-logo { @svg: escape( '' ); content: url("data:image/svg+xml,@{svg}"); } img[alt="Change settings"] { @svg: escape( '' ); content: url("data:image/svg+xml,@{svg}"); } #settings-menu { img[alt="Change settings"] { @svg: escape( '' ); content: url("data:image/svg+xml,@{svg}"); } > a:not(:has(img))::before { @svg: escape( '' ); content: url("data:image/svg+xml,@{svg}"); } } .setting-check input:checked { @svg: escape( '' ); content: url("data:image/svg+xml,@{svg}"); } #copy-path { @raw: ''; @raw_before: ''; > img { @svg: escape(replace(@raw, "%COLOR%", @subtext0)); content: url("data:image/svg+xml,@{svg}"); filter: none; } &:hover > img { @svg: escape(replace(@raw, "%COLOR%", @text)); content: url("data:image/svg+xml,@{svg}"); filter: none; } &:not(:has(> img)) { &::before { @svg: escape(replace(@raw_before, "%COLOR%", @subtext0)); content: url("data:image/svg+xml,@{svg}"); filter: none; } &:hover::before { @svg: escape(replace(@raw_before, "%COLOR%", @text)); content: url("data:image/svg+xml,@{svg}"); filter: none; } } } details.toggle { @plus: escape( '' ); @minus: escape( '' ); > summary::before { background: url("data:image/svg+xml,@{plus}") no-repeat top left; filter: none; } &[open] > summary::before { background: url("data:image/svg+xml,@{minus}") no-repeat top left; } } .src #sidebar-button > a::before { @svg: escape( '' ); content: url("data:image/svg+xml,@{svg}"); } .pure-menu-link { color: @subtext0; &:hover { color: @text; } } .pure-table { &, td, th { border-color: @surface0; } } } } /* deno-fmt-ignore */ @catppuccin: { @latte: { @rosewater: #dc8a78; @flamingo: #dd7878; @pink: #ea76cb; @mauve: #8839ef; @red: #d20f39; @maroon: #e64553; @peach: #fe640b; @yellow: #df8e1d; @green: #40a02b; @teal: #179299; @sky: #04a5e5; @sapphire: #209fb5; @blue: #1e66f5; @lavender: #7287fd; @text: #4c4f69; @subtext1: #5c5f77; @subtext0: #6c6f85; @overlay2: #7c7f93; @overlay1: #8c8fa1; @overlay0: #9ca0b0; @surface2: #acb0be; @surface1: #bcc0cc; @surface0: #ccd0da; @base: #eff1f5; @mantle: #e6e9ef; @crust: #dce0e8; }; @frappe: { @rosewater: #f2d5cf; @flamingo: #eebebe; @pink: #f4b8e4; @mauve: #ca9ee6; @red: #e78284; @maroon: #ea999c; @peach: #ef9f76; @yellow: #e5c890; @green: #a6d189; @teal: #81c8be; @sky: #99d1db; @sapphire: #85c1dc; @blue: #8caaee; @lavender: #babbf1; @text: #c6d0f5; @subtext1: #b5bfe2; @subtext0: #a5adce; @overlay2: #949cbb; @overlay1: #838ba7; @overlay0: #737994; @surface2: #626880; @surface1: #51576d; @surface0: #414559; @base: #303446; @mantle: #292c3c; @crust: #232634; }; @macchiato: { @rosewater: #f4dbd6; @flamingo: #f0c6c6; @pink: #f5bde6; @mauve: #c6a0f6; @red: #ed8796; @maroon: #ee99a0; @peach: #f5a97f; @yellow: #eed49f; @green: #a6da95; @teal: #8bd5ca; @sky: #91d7e3; @sapphire: #7dc4e4; @blue: #8aadf4; @lavender: #b7bdf8; @text: #cad3f5; @subtext1: #b8c0e0; @subtext0: #a5adcb; @overlay2: #939ab7; @overlay1: #8087a2; @overlay0: #6e738d; @surface2: #5b6078; @surface1: #494d64; @surface0: #363a4f; @base: #24273a; @mantle: #1e2030; @crust: #181926; }; @mocha: { @rosewater: #f5e0dc; @flamingo: #f2cdcd; @pink: #f5c2e7; @mauve: #cba6f7; @red: #f38ba8; @maroon: #eba0ac; @peach: #fab387; @yellow: #f9e2af; @green: #a6e3a1; @teal: #94e2d5; @sky: #89dceb; @sapphire: #74c7ec; @blue: #89b4fa; @lavender: #b4befe; @text: #f4f4f4; @subtext1: #e0e0e0; @subtext0: #c6c6c6; @overlay2: #a8a8a8; @overlay1: #8d8d8d; @overlay0: #6f6f6f; @surface2: #525252; @surface1: #393939; @surface0: #262626; @base: #161616; @mantle: #0b0b0b; @crust: #000000; }; };