diff --git a/styles/lichess/catppuccin.user.less b/styles/lichess/catppuccin.user.less index cdf93638..3788a7b7 100644 --- a/styles/lichess/catppuccin.user.less +++ b/styles/lichess/catppuccin.user.less @@ -13,7 +13,11 @@ @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"] + +@var select lastMoveColor "Last Move" ["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"] +@var select checkColor "Check Indicator" ["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"] @var checkbox stylePieces "Style Pieces" 1 +@var checkbox styleBoard "Style Board" 1 ==/UserStyle== */ @import "https://userstyles.catppuccin.com/lib/lib.less"; @@ -38,6 +42,9 @@ #lib.palette(); #lib.defaults(); + @lastMove: @catppuccin[@@flavor][@@lastMoveColor]; + @check: @catppuccin[@@flavor][@@checkColor]; + &, body { background: @base linear-gradient(to bottom, @crust, @base 116px) @@ -243,11 +250,80 @@ } /* Chess Game */ - .brown .is2d cg-board { - @svg: escape( - '' - ); - background-image: url("data:image/svg+xml,@{svg}") !important; + @light-cell: if(@flavor = latte, @surface0, @accent); + @dark-cell: if(@flavor = latte, @accent, @surface0); + & when (@styleBoard = 1) { + /* Board */ + .is2d cg-board::before { + @svg: escape( + '' + ); + background-image: url("data:image/svg+xml,@{svg}") !important; + } + + /* File and Rank Coords */ + .orientation-white .files coord:nth-child(2n+1), + .orientation-white .ranks coord:nth-child(2n), + .orientation-black .files coord:nth-child(2n), + .orientation-black .ranks coord:nth-child(2n+1) { + color: @light-cell; + } + .orientation-white .files coord:nth-child(2n), + .orientation-white .ranks coord:nth-child(2n+1), + .orientation-black .files coord:nth-child(2n+1), + .orientation-black .ranks coord:nth-child(2n) { + color: @dark-cell; + } + + /* Squares */ + square { + &.move-dest { + background: radial-gradient( + @overlay1 19%, + rgba(0, 0, 0, 0) 20% + ); + } + + &.selected { + background: fade(@accent, 50%); + } + + &.last-move { + background-color: fade(@lastMove, 75%); + } + + &.check { + background: radial-gradient( + ellipse at center, + @check 0%, + @check 25%, + fade(@check, 0%) 89%, + fade(@check, 0%) 100% + ); + } + + /* Capture indicator */ + &.oc.move-dest { + background: radial-gradient( + transparent 0%, + transparent 79%, + fade(@overlay1, 50%) 80% + ); + } + } + + /* Analysis Arrows */ + svg.cg-shapes g { + &[cgHash$="green"] { + filter: @green-filter; + } + &[cgHash$="paleBlue"] { + filter: @sky-filter; + } + &[cgHash$="red"] { + filter: @red-filter; + } + } } & when (@stylePieces = 1) { .is2d .pawn { @@ -336,30 +412,6 @@ } } - .orientation-white .files coord:nth-child(2n+1), - .orientation-white .ranks coord:nth-child(2n), - .orientation-black .files coord:nth-child(2n), - .orientation-black .ranks coord:nth-child(2n+1) { - color: @base; - } - .orientation-white .files coord:nth-child(2n), - .orientation-white .ranks coord:nth-child(2n+1), - .orientation-black .files coord:nth-child(2n+1), - .orientation-black .ranks coord:nth-child(2n) { - color: @crust; - } - square.move-dest { - background: radial-gradient( - fade(@accent, 50%) 19%, - rgba(0, 0, 0, 0) 20% - ); - } - square.selected { - background: fade(@accent, 50%); - } - square.last-move { - background: fade(@accent, 40%); - } .rclock .time { background: @mantle; color: @text; @@ -371,19 +423,6 @@ background: @accent; } - /* Analysis Arrows */ - svg.cg-shapes g { - &[cgHash$="green"] { - filter: @green-filter; - } - &[cgHash$="paleBlue"] { - filter: @sky-filter; - } - &[cgHash$="red"] { - filter: @red-filter; - } - } - /* Game Cards */ .game__meta, .round__app__table { @@ -500,14 +539,15 @@ } .ceval .bar span { background: @green; + + &.threat { + background: @red; + } } .show-threat.active, .show-threat:hover:not(.hidden) { color: @red; } - .ceval .bar span.threat { - background: @red; - } /* Openings */ .opening__config, .opening__next {