diff --git a/scripts/userstyles.yml b/scripts/userstyles.yml index 6431246545..6628870a3e 100644 --- a/scripts/userstyles.yml +++ b/scripts/userstyles.yml @@ -262,6 +262,14 @@ userstyles: readme: app-link: "https://deepl.com" current-maintainers: [*watatomo] + docs.rs: + name: docs.rs + categories: [development] + icon: rust + color: yellow + readme: + app-link: "https://docs.rs" + current-maintainers: [*uncenter] duckduckgo: name: DuckDuckGo categories: [search_engine] diff --git a/styles/docs.rs/catppuccin.user.css b/styles/docs.rs/catppuccin.user.css new file mode 100644 index 0000000000..65bc8015b3 --- /dev/null +++ b/styles/docs.rs/catppuccin.user.css @@ -0,0 +1,340 @@ +/* ==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 0.0.1 +@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') { + @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: @overlay2; + --color-doc-link-hover: @accent-color; + --color-error-hover: #be2525; + --color-error: #d93d3d; + --color-macro: #068000; + --color-menu-border: #cdcdcd; + --color-menu-header-background: #e0e0e0; + --color-navbar-standard: @text; + --color-standard: @subtext1; + --color-brand: @text; + --color-struct: #df3600; + --color-type: #e57300; + --color-url: @accent-color; + --color-warn-background: #6b3603; + --color-warn-msg: #d8d8d8; + --color-warn-hover: #b25900; + --color-warn: @peach; + --color-background-input: @mantle; + --color-table-header-background: #545252; + --color-table-header: #000; + --color-search-focus: #078dd8; + --chart-title-color: #c0c0c0; + --chart-grid: #4e4e4e; + + --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; + --code-block-background-color: @mantle; + --scrollbar-track-background-color: #717171; + --scrollbar-thumb-background-color: rgba(32, 34, 37, 0.6); + --scrollbar-color: rgba(32, 34, 37, 0.6) #5a5a5a; + --headings-border-bottom-color: @overlay1; + --border-color: @surface0; + --button-background-color: @mantle; + --right-side-color: grey; + --code-attribute-color: #999; + --toggles-color: @subtext1; + --toggle-filter: invert(100%); + --mobile-sidebar-menu-filter: invert(100%); + --search-input-focused-border-color: @accent-color; + --copy-path-button-color: @text; + --copy-path-img-filter: invert(50%); + --copy-path-img-hover-filter: invert(65%); + --codeblock-error-hover-color: rgb(255, 0, 0); + --codeblock-error-color: rgba(255, 0, 0, 0.5); + --codeblock-ignore-hover-color: rgb(255, 142, 0); + --codeblock-ignore-color: rgba(255, 142, 0, 0.6); + --warning-border-color: #ff8e00; + --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: #aaa3; + --search-color: @text; + --search-error-code-background-color: #484848; + --search-results-alias-color: #fff; + --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: @overlay0; + --code-highlight-doc-comment-color: @overlay0; + --color-syntax-foreground: inherit; + --color-syntax-attribute: @yellow; + --color-syntax-background: @mantle; + --color-syntax-bool: @red; + --color-syntax-comment: @overlay0; + --color-syntax-doc-comment: @overlay0; + --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: rgba(78, 139, 202, 0.2); + --test-arrow-hover-color: #dedede; + --test-arrow-hover-background-color: #4e8bca; + --target-background-color: fade(@accent-color, 10%); + --target-border-color: @accent-color; + --kbd-color: @text; + --kbd-background: @mantle; + --kbd-box-shadow-color: @surface1; + --rust-logo-filter: drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) + drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff); + --crate-search-div-filter: invert(94%) sepia(0%) saturate(721%) + hue-rotate(255deg) brightness(90%) contrast(90%); + --crate-search-div-hover-filter: invert(69%) sepia(60%) saturate(6613%) + hue-rotate(184deg) brightness(100%) contrast(91%); + --crate-search-hover-border: #2196f3; + --src-sidebar-background-selected: @surface0; + --src-sidebar-background-hover: @surface1; + --table-alt-row-background-color: #2a2a2a; + --codeblock-link-background: #333; + --scrape-example-toggle-line-background: #999; + --scrape-example-toggle-line-hover-background: #c5c5c5; + --scrape-example-code-line-highlight: #5b3b01; + --scrape-example-code-line-highlight-focus: #7c4b0f; + --scrape-example-help-border-color: #aaa; + --scrape-example-help-color: #eee; + --scrape-example-help-hover-border-color: #fff; + --scrape-example-help-hover-color: #fff; + --scrape-example-code-wrapper-background-start: rgba(53, 53, 53, 1); + --scrape-example-code-wrapper-background-end: rgba(53, 53, 53, 0); + --sidebar-resizer-hover: hsl(207, 30%, 54%); + --sidebar-resizer-active: hsl(207, 90%, 54%); + + select { + background-color: @mantle; + border-color: @surface0; + } + + 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 diff --git a/styles/docs.rs/preview.webp b/styles/docs.rs/preview.webp new file mode 100644 index 0000000000..c5689cb722 --- /dev/null +++ b/styles/docs.rs/preview.webp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17c6374e28c3bea67f8e08e1e9d30a832d4795e8446706f917180be8d4ada957 +size 84206