/* ==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.28 @updateURL https://github.com/catppuccin/userstyles/raw/main/styles/docs.rs/catppuccin.user.css @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') { @media (prefers-color-scheme: light) { :root:not([data-docs-rs-theme]) { #catppuccin(@lightFlavor, @accentColor); } } @media (prefers-color-scheme: dark) { :root:not([data-docs-rs-theme]) { #catppuccin(@darkFlavor, @accentColor); } } :root[data-docs-rs-theme="dark"] { #catppuccin(@darkFlavor, @accentColor); } :root[data-docs-rs-theme="light"] { #catppuccin(@lightFlavor, @accentColor); } #catppuccin(@lookup, @accent) { @rosewater: @catppuccin[@@lookup][@rosewater]; @flamingo: @catppuccin[@@lookup][@flamingo]; @pink: @catppuccin[@@lookup][@pink]; @mauve: @catppuccin[@@lookup][@mauve]; @red: @catppuccin[@@lookup][@red]; @maroon: @catppuccin[@@lookup][@maroon]; @peach: @catppuccin[@@lookup][@peach]; @yellow: @catppuccin[@@lookup][@yellow]; @green: @catppuccin[@@lookup][@green]; @teal: @catppuccin[@@lookup][@teal]; @sky: @catppuccin[@@lookup][@sky]; @sapphire: @catppuccin[@@lookup][@sapphire]; @blue: @catppuccin[@@lookup][@blue]; @lavender: @catppuccin[@@lookup][@lavender]; @text: @catppuccin[@@lookup][@text]; @subtext1: @catppuccin[@@lookup][@subtext1]; @subtext0: @catppuccin[@@lookup][@subtext0]; @overlay2: @catppuccin[@@lookup][@overlay2]; @overlay1: @catppuccin[@@lookup][@overlay1]; @overlay0: @catppuccin[@@lookup][@overlay0]; @surface2: @catppuccin[@@lookup][@surface2]; @surface1: @catppuccin[@@lookup][@surface1]; @surface0: @catppuccin[@@lookup][@surface0]; @base: @catppuccin[@@lookup][@base]; @mantle: @catppuccin[@@lookup][@mantle]; @crust: @catppuccin[@@lookup][@crust]; @accent-color: @catppuccin[@@lookup][@@accent]; color-scheme: if(@lookup = latte, light, dark); ::selection { background-color: fade(@accent-color, 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; --color-border-light: @surface2; --color-border: @surface0; --color-doc-link-background: @accent-color; --color-doc-link-hover: @accent-color; --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; --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-color; --settings-input-border-color: @surface0; --settings-button-color: @text; --settings-button-border-focus: @accent-color; --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-color; --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-color; --link-color: @accent-color; --sidebar-link-color: @accent-color; --sidebar-current-link-background-color: @surface0; --search-result-link-focus-background-color: fade(@accent-color, 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-color; --search-tab-button-selected-background: @base; --stab-background-color: @surface0; --stab-code-color: @accent-color; --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-color; --src-line-number-highlighted-background-color: fade(@accent-color, 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-color, 10%); --target-border-color: @accent-color; --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-color, 40%); --scrape-example-code-line-highlight-focus: fade(@accent-color, 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; } } } } /* prettier-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: #cdd6f4; @subtext1: #bac2de; @subtext0: #a6adc8; @overlay2: #9399b2; @overlay1: #7f849c; @overlay0: #6c7086; @surface2: #585b70; @surface1: #45475a; @surface0: #313244; @base: #1e1e2e; @mantle: #181825; @crust: #11111b; }; } // vim:ft=less