|
| 1 | +/* ==UserStyle== |
| 2 | +@name Substack Catppuccin |
| 3 | +@namespace github.com/catppuccin/userstyles/styles/substack |
| 4 | +@homepageURL https://github.com/catppuccin/userstyles/tree/main/styles/substack |
| 5 | +@version 0.1.0 |
| 6 | +@description Soothing pastel theme for Substack |
| 7 | +@updateURL https://github.com/catppuccin/userstyles/raw/main/styles/substack/catppuccin.user.css |
| 8 | +@author Catppuccin |
| 9 | +@license MIT |
| 10 | +
|
| 11 | +@preprocessor less |
| 12 | +@var select lightFlavor "Light Flavor" ["latte:Latte*", "frappe:Frappé", "macchiato:Macchiato", "mocha:Mocha"] |
| 13 | +@var select darkFlavor "Dark Flavor" ["latte:Latte", "frappe:Frappé", "macchiato:Macchiato", "mocha:Mocha*"] |
| 14 | +@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"] |
| 15 | +==/UserStyle== */ |
| 16 | +@-moz-document regexp("https:\/\/(.+\.)?substack.com/.*") { |
| 17 | + #catppuccin(@lookup, @accent-color) { |
| 18 | + @rosewater: @catppuccin[@@lookup][@rosewater]; |
| 19 | + @flamingo: @catppuccin[@@lookup][@flamingo]; |
| 20 | + @pink: @catppuccin[@@lookup][@pink]; |
| 21 | + @mauve: @catppuccin[@@lookup][@mauve]; |
| 22 | + @red: @catppuccin[@@lookup][@red]; |
| 23 | + @maroon: @catppuccin[@@lookup][@maroon]; |
| 24 | + @peach: @catppuccin[@@lookup][@peach]; |
| 25 | + @yellow: @catppuccin[@@lookup][@yellow]; |
| 26 | + @green: @catppuccin[@@lookup][@green]; |
| 27 | + @teal: @catppuccin[@@lookup][@teal]; |
| 28 | + @sky: @catppuccin[@@lookup][@sky]; |
| 29 | + @sapphire: @catppuccin[@@lookup][@sapphire]; |
| 30 | + @blue: @catppuccin[@@lookup][@blue]; |
| 31 | + @lavender: @catppuccin[@@lookup][@lavender]; |
| 32 | + @text: @catppuccin[@@lookup][@text]; |
| 33 | + @subtext1: @catppuccin[@@lookup][@subtext1]; |
| 34 | + @subtext0: @catppuccin[@@lookup][@subtext0]; |
| 35 | + @overlay2: @catppuccin[@@lookup][@overlay2]; |
| 36 | + @overlay1: @catppuccin[@@lookup][@overlay1]; |
| 37 | + @overlay0: @catppuccin[@@lookup][@overlay0]; |
| 38 | + @surface2: @catppuccin[@@lookup][@surface2]; |
| 39 | + @surface1: @catppuccin[@@lookup][@surface1]; |
| 40 | + @surface0: @catppuccin[@@lookup][@surface0]; |
| 41 | + @base: @catppuccin[@@lookup][@base]; |
| 42 | + @mantle: @catppuccin[@@lookup][@mantle]; |
| 43 | + @crust: @catppuccin[@@lookup][@crust]; |
| 44 | + @accent: @catppuccin[@@lookup][@@accent-color]; |
| 45 | + |
| 46 | + html { |
| 47 | + background-color: @base !important; |
| 48 | + } |
| 49 | + |
| 50 | + :root, |
| 51 | + .dark-mode { |
| 52 | + --color-primary: @text; |
| 53 | + --color-secondary: @subtext0; |
| 54 | + --color-bg-primary: @base; |
| 55 | + --color-bg-primary-rgb: #rgbify(@base) []; |
| 56 | + --web_bg_color: @base; |
| 57 | + --color-bg-primary-hover: mix(@surface0, @base, 50%); |
| 58 | + --color-bg-secondary: @mantle; |
| 59 | + --color-bg-tertiary: @crust; |
| 60 | + --color-dark-bg-tertiary: @crust; |
| 61 | + --color-dark-primary: @text; |
| 62 | + --color-bg-elevated: @surface0; |
| 63 | + --color-bg-elevated-hover: mix(@surface1, @surface0, 50%); |
| 64 | + --color-accent-themed: @accent; |
| 65 | + --color-bg-secondary-opacity: @surface0; |
| 66 | + --color-bg-secondary-themed: @surface0; |
| 67 | + --color-accent-inverse-themed: @crust; |
| 68 | + --color-light-bg-primary: @crust; |
| 69 | + --color-accent-primary: @accent; |
| 70 | + --color-accent-substack: @accent; |
| 71 | + --color-accent-blue: @blue; |
| 72 | + --color-accent-red: @red; |
| 73 | + --color-accent-purple: @mauve; |
| 74 | + --color-accent-facebook: @blue; |
| 75 | + --color-light-bg-primary: @crust; |
| 76 | + --color-accent-error: @red; |
| 77 | + --color-detail: @surface1; |
| 78 | + --color-dark-bg-primary: @mantle; |
| 79 | + |
| 80 | + // subdomains |
| 81 | + --print_on_web_bg_color: @text; |
| 82 | + --color-secondary-themed: @subtext0; |
| 83 | + --print_secondary_on_web_bg_color: @subtext0; |
| 84 | + --background_pop: @peach; |
| 85 | + --print_pop: @peach; |
| 86 | + --print_on_pop: @crust; |
| 87 | + --print_secondary: @subtext0; |
| 88 | + --web_bg_color: @base; |
| 89 | + --color-tertiary: @crust; |
| 90 | + --background_contrast_1: @crust; |
| 91 | + --background_contrast_2: mix(@crust, @mantle, 50%); |
| 92 | + --background_contrast_3: @mantle; |
| 93 | + --background_contrast_4: mix(@mantle, @base, 33%); |
| 94 | + --background_contrast_5: mix(@mantle, @base, 66%); |
| 95 | + --color_theme_bg_contrast_1: @surface0; |
| 96 | + --color_theme_bg_contrast_2: mix(@surface0, @surface1, 50%); |
| 97 | + --color_theme_bg_contrast_3: @surface1; |
| 98 | + --color_theme_bg_contrast_4: mix(@surface1, @surface2, 50%); |
| 99 | + --color_theme_bg_contrast_5: @surface2; |
| 100 | + |
| 101 | + // used for podcast play controls |
| 102 | + --color_theme_bg_pop_rgb: #rgbify(@accent) []; |
| 103 | + --color_theme_print_on_pop: @crust; |
| 104 | + } |
| 105 | + |
| 106 | + // brand colors in SVGs |
| 107 | + // Substack orange |
| 108 | + *[stroke="#ff6719"], |
| 109 | + *[stroke="#FF6719"] { |
| 110 | + stroke: @peach !important; |
| 111 | + } |
| 112 | + *[fill="#ff6719"], |
| 113 | + *[fill="#FF6719"] { |
| 114 | + fill: @peach !important; |
| 115 | + } |
| 116 | + |
| 117 | + .footer-wrap .footer .footer-substack-cta { |
| 118 | + background-color: @base; |
| 119 | + } |
| 120 | + |
| 121 | + .reader-nav-top.pinned { |
| 122 | + background-color: rgba(#rgbify(@base) [], 85%); |
| 123 | + backdrop-filter: var(--glass); |
| 124 | + } |
| 125 | + |
| 126 | + // toggle switches |
| 127 | + .tailwind-preflight button span { |
| 128 | + background-color: @base !important; |
| 129 | + } |
| 130 | + |
| 131 | + // restack quote popup |
| 132 | + div[class*="frontend-components-selection_popover-module"] { |
| 133 | + * { |
| 134 | + color: @text !important; |
| 135 | + background: @base !important; |
| 136 | + border-color: @surface0 !important; |
| 137 | + stroke: @text !important; |
| 138 | + } |
| 139 | + } |
| 140 | + } |
| 141 | + |
| 142 | + @media (prefers-color-scheme: dark) { |
| 143 | + #catppuccin(@darkFlavor, @accentColor); |
| 144 | + } |
| 145 | + @media (prefers-color-scheme: light) { |
| 146 | + #catppuccin(@lightFlavor, @accentColor); |
| 147 | + } |
| 148 | + |
| 149 | + #rgbify(@color) { |
| 150 | + @rgb-raw: red(@color), green(@color), blue(@color); |
| 151 | + } |
| 152 | + |
| 153 | + // prettier-ignore |
| 154 | + @catppuccin: { |
| 155 | + @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; }; |
| 156 | + @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; }; |
| 157 | + @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; }; |
| 158 | + @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; }; |
| 159 | + } |
| 160 | +} |
| 161 | + |
| 162 | +// vim:ft=less |
0 commit comments