From 28a4b15aa55da7659bb1c19fe8a842e3f30ecf7c Mon Sep 17 00:00:00 2001 From: uncenter <47499684+uncenter@users.noreply.github.com> Date: Wed, 21 Feb 2024 22:58:07 -0800 Subject: [PATCH] feat(stack-overflow): init --- scripts/userstyles.yml | 8 + styles/stack-overflow/catppuccin.user.css | 244 ++++++++++++++++++++++ 2 files changed, 252 insertions(+) create mode 100644 styles/stack-overflow/catppuccin.user.css diff --git a/scripts/userstyles.yml b/scripts/userstyles.yml index bd1216649a..cdccfb9489 100644 --- a/scripts/userstyles.yml +++ b/scripts/userstyles.yml @@ -586,6 +586,14 @@ userstyles: usage: "Switch to a default Skiff light/dark theme via **Settings** > **Appearance** for the best experience!" app-link: "https://app.skiff.com/mail" current-maintainers: [*coopw1] + stack-overflow: + name: Stack Overflow + category: development + color: peach + icon: stackoverflow + readme: + app-link: "https://stackoverflow.com/" + current-maintainers: [*uncenter] stylus: name: Stylus category: productivity diff --git a/styles/stack-overflow/catppuccin.user.css b/styles/stack-overflow/catppuccin.user.css new file mode 100644 index 0000000000..894623b749 --- /dev/null +++ b/styles/stack-overflow/catppuccin.user.css @@ -0,0 +1,244 @@ +/* ==UserStyle== +@name Stack Overflow Catppuccin +@namespace github.com/catppuccin/userstyles/styles/stack-overflow +@homepageURL https://github.com/catppuccin/userstyles/tree/main/styles/stack-overflow +@version 0.0.1 +@updateURL https://github.com/catppuccin/userstyles/raw/main/styles/stack-overflow/catppuccin.user.css +@supportURL https://github.com/catppuccin/userstyles/issues?q=is%3Aopen+is%3Aissue+label%3Astack-overflow +@description Soothing pastel theme for Stack Overflow +@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('stackoverflow.com') { + // TODO: Switch back to the @import (and remove 22-163) once we can get !important's in there. + // @import url("https://unpkg.com/@catppuccin/highlightjs@0.1.2/css/catppuccin.variables.css"); + /* prettier-ignore */ + code {&.hljs{color: rgb(var(--ctp-text)) !important;}.hljs-emphasis,.hljs-link,.hljs-quote{font-style:italic!important}.hljs-keyword,.hljs-name,.hljs-selector-attr,.hljs-variable,.hljs-variable.language_{color:rgb(var(--ctp-mauve))!important}.hljs-built_in,.hljs-doctag{color:rgb(var(--ctp-red))!important}.hljs-selector-tag,.hljs-title.class_,.hljs-type{color:rgb(var(--ctp-yellow))!important}.hljs-literal,.hljs-meta,.hljs-number,.hljs-variable.constant_{color:rgb(var(--ctp-peach))!important}.hljs-bullet,.hljs-formula,.hljs-operator,.hljs-property,.hljs-selector-class,.hljs-selector-pseudo{color:rgb(var(--ctp-teal))!important}.hljs-punctuation{color:rgb(var(--ctp-subtext1))!important}.hljs-regexp{color:rgb(var(--ctp-pink))!important}.hljs-attribute,.hljs-char.escape_,.hljs-code,.hljs-string{color:rgb(var(--ctp-green))!important}.hljs-subst,.hljs-tag{color:rgb(var(--ctp-subtext0))!important}.hljs-symbol,.hljs-template-tag,.hljs-template-variable{color:rgb(var(--ctp-flamingo))!important}.hljs-attr,.hljs-section,.hljs-selector-id,.hljs-title,.hljs-title.function_{color:rgb(var(--ctp-blue))!important}.hljs-params{color:rgb(var(--ctp-text))!important}.hljs-comment{color:rgb(var(--ctp-surface2))!important}.hljs-emphasis,.hljs-strong{color:rgb(var(--ctp-red))!important}.hljs-strong{font-weight:700!important}.hljs-link{color:rgb(var(--ctp-sapphire))!important}.hljs-diff-addition,.hljs-quote{color:rgb(var(--ctp-green))!important}.hljs-diff-addition{background:rgba(var(--ctp-green),15%)!important}.hljs-diff-deletion{color:rgb(var(--ctp-red))!important;background:rgba(var(--ctp-red),15%)!important}} + + /* 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; }; + } + + #rgbify(@color) { + @rgb-raw: red(@color), green(@color), blue(@color); + } + + #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]; + + --ctp-rosewater: #rgbify(@rosewater) []; + --ctp-flamingo: #rgbify(@flamingo) []; + --ctp-pink: #rgbify(@pink) []; + --ctp-mauve: #rgbify(@mauve) []; + --ctp-red: #rgbify(@red) []; + --ctp-maroon: #rgbify(@maroon) []; + --ctp-peach: #rgbify(@peach) []; + --ctp-yellow: #rgbify(@yellow) []; + --ctp-green: #rgbify(@green) []; + --ctp-teal: #rgbify(@teal) []; + --ctp-sky: #rgbify(@sky) []; + --ctp-sapphire: #rgbify(@sapphire) []; + --ctp-blue: #rgbify(@blue) []; + --ctp-lavender: #rgbify(@lavender) []; + --ctp-text: #rgbify(@text) []; + --ctp-subtext1: #rgbify(@subtext1) []; + --ctp-subtext0: #rgbify(@subtext0) []; + --ctp-overlay2: #rgbify(@overlay2) []; + --ctp-overlay1: #rgbify(@overlay1) []; + --ctp-overlay0: #rgbify(@overlay0) []; + --ctp-surface2: #rgbify(@surface2) []; + --ctp-surface1: #rgbify(@surface1) []; + --ctp-surface0: #rgbify(@surface0) []; + --ctp-base: #rgbify(@crust) []; + --ctp-mantle: #rgbify(@mantle) []; + --ctp-crust: #rgbify(@crust) []; + + --white: @crust; + --black-050: @crust; + --black-100: @mantle; + --black-150: @surface0; + --black-200: @surface0; + --black-225: @surface1; + --black-250: @surface2; + --black-300: @overlay0; + --black-350: @subtext0; + --black-400: @subtext1; + --black-500: @text; + --black-600: @text; + --black: @text; + + & when (@lookup = latte) { + --orange-600: darken(@peach, 30%); + --orange-500: darken(@peach, 20%); + --orange-400: darken(@peach, 10%); + --orange-300: @peach; + --orange-200: lighten(tint(@peach, 10%), 10%); + --orange-100: lighten(tint(@peach, 20%), 20%); + --blue-600: desaturate(darken(@blue, 30%), 40%); + --blue-500: desaturate(darken(@blue, 20%), 40%); + --blue-400: desaturate(darken(@blue, 10%), 40%); + --blue-300: @blue; + --blue-200: lighten(@blue, 10%); + --blue-100: lighten(@blue, 20%); + --green-600: saturate(darken(@green, 30%), 5%); + --green-500: saturate(darken(@green, 20%), 5%); + --green-400: saturate(darken(@green, 10%), 5%); + --green-300: @green; + --green-200: lighten(@green, 10%); + --green-100: lighten(@green, 20%); + --red-600: desaturate(darken(@red, 30%), 40%); + --red-500: desaturate(darken(@red, 20%), 40%); + --red-400: desaturate(darken(@red, 10%), 40%); + --red-300: @red; + --red-200: lighten(@red, 10%); + --red-100: lighten(@red, 20%); + --yellow-600: desaturate(darken(@yellow, 30%), 40%); + --yellow-500: desaturate(darken(@yellow, 20%), 40%); + --yellow-400: desaturate(darken(@yellow, 10%), 40%); + --yellow-300: @yellow; + --yellow-200: lighten(@yellow, 10%); + --yellow-100: lighten(@yellow, 20%); + --purple-600: darken(@lavender, 30%); + --purple-500: darken(@lavender, 20%); + --purple-400: darken(@lavender, 10%); + --purple-300: @lavender; + --purple-200: lighten(@lavender, 5%); + --purple-100: lighten(@lavender, 10%); + } + & when not (@lookup = latte) { + --orange-100: darken(shade(@peach, 50%), 10%); + --orange-200: darken(shade(@peach, 40%), 10%); + --orange-300: darken(shade(@peach, 30%), 10%); + --orange-400: darken(shade(@peach, 20%), 10%); + --orange-500: lighten(@peach, 10%); + --orange-600: lighten(@peach, 20%); + --blue-100: desaturate(darken(@blue, 30%), 40%); + --blue-200: desaturate(darken(@blue, 20%), 40%); + --blue-300: desaturate(darken(@blue, 10%), 40%); + --blue-400: @blue; + --blue-500: lighten(@blue, 10%); + --blue-600: lighten(@blue, 20%); + --green-100: saturate(darken(@green, 30%), 5%); + --green-200: saturate(darken(@green, 20%), 5%); + --green-300: saturate(darken(@green, 10%), 5%); + --green-400: @green; + --green-500: lighten(@green, 10%); + --green-600: lighten(@green, 20%); + --red-100: desaturate(darken(@red, 30%), 40%); + --red-200: desaturate(darken(@red, 20%), 40%); + --red-300: desaturate(darken(@red, 10%), 40%); + --red-400: @red; + --red-500: lighten(@red, 10%); + --red-600: lighten(@red, 20%); + --yellow-100: darken(shade(@yellow, 50%), 10%); + --yellow-200: darken(shade(@yellow, 40%), 10%); + --yellow-300: darken(shade(@yellow, 30%), 10%); + --yellow-400: darken(shade(@yellow, 20%), 10%); + --yellow-500: lighten(@yellow, 10%); + --yellow-600: lighten(@yellow, 20%); + --purple-100: darken(@lavender, 30%); + --purple-200: darken(@lavender, 20%); + --purple-300: darken(@lavender, 10%); + --purple-400: @lavender; + --purple-500: lighten(@lavender, 5%); + --purple-600: lighten(@lavender, 10%); + --gold-100: hsl(45, 29%, 24%); + --gold-200: hsl(45, 47%, 37%); + --gold-300: hsl(45, 92%, 62%); + --gold-400: hsl(46, 93%, 78%); + --silver-100: hsl(220, 2%, 26%); + --silver-200: hsl(220, 1%, 46%); + --silver-300: hsl(216, 4%, 69%); + --silver-400: hsl(214, 8%, 83%); + --bronze-100: hsl(28, 13%, 27%); + --bronze-200: hsl(28, 27%, 45%); + --bronze-300: hsl(28, 58%, 67%); + --bronze-400: hsl(28, 59%, 83%); + --bs-sm: 0 1px 2px hsla(0, 0%, 0%, 0.1), 0 1px 4px hsla(0, 0%, 0%, 0.1), + 0 2px 8px hsla(0, 0%, 0%, 0.1); + --bs-md: 0 1px 3px hsla(0, 0%, 0%, 0.11), 0 2px 6px hsla(0, 0%, 0%, 0.11), + 0 3px 8px hsla(0, 0%, 0%, 0.14); + --bs-lg: 0 1px 4px hsla(0, 0%, 0%, 0.14), 0 3px 8px hsla(0, 0%, 0%, 0.14), + 0 4px 13px hsla(0, 0%, 0%, 0.18); + --bs-xl: 0 10px 24px hsla(0, 0%, 0%, 0.1), + 0 20px 48px hsla(0, 0%, 0%, 0.1), 0 1px 4px hsla(0, 0%, 0%, 0.15); + --focus-ring: var( + --theme-dark-secondary-custom-focus-ring, + hsla(206, 100%, 40%, 0.25) + ); + --focus-ring-success: hsla(140, 40%, 75%, 0.4); + --focus-ring-warning: hsla(47, 79%, 58%, 0.4); + --focus-ring-error: hsla(358, 62%, 47%, 0.15); + --focus-ring-muted: hsla(210, 8%, 15%, 0.1); + } + --highlight-bg: @base; + --scrollbar: fade(@text, 20%); + + .site-footer { + background-color: @mantle !important; + } + + .s-topbar .s-topbar--logo .-img { + @svg: escape( + '' + ); + background-image: url("data:image/svg+xml,@{svg}") !important; + filter: none; + } + } + + body:not(.theme-highcontrast).theme-dark { + #catppuccin(@darkFlavor, @accentColor); + } + body:not(.theme-highcontrast, .theme-dark, .theme-system) { + #catppuccin(@lightFlavor, @accentColor); + } + body:not(.theme-highcontrast).theme-system { + @media (prefers-color-scheme: light) { + #catppuccin(@lightFlavor, @accentColor); + } + @media (prefers-color-scheme: dark) { + #catppuccin(@darkFlavor, @accentColor); + } + } +} +// vim:ft=less + +// TODO: Footer styling (appears unchanged by CSS vars). +// TODO: StackOverflow logo in header styling (not working in all themes).