From 8f9852ef3d500b07912cf5bb8c61c135d2e6f1c9 Mon Sep 17 00:00:00 2001 From: uncenter Date: Mon, 13 Apr 2026 10:55:57 -0500 Subject: [PATCH] feat(chess.com): neo piece set & always use mocha colors (#2151) --- styles/chess.com/catppuccin.user.less | 118 ++++++++++---------------- 1 file changed, 43 insertions(+), 75 deletions(-) diff --git a/styles/chess.com/catppuccin.user.less b/styles/chess.com/catppuccin.user.less index e50d9408..71b47852 100644 --- a/styles/chess.com/catppuccin.user.less +++ b/styles/chess.com/catppuccin.user.less @@ -603,8 +603,8 @@ } /* Board */ - @light-cell: if(@flavor = latte, @surface0, @accent); - @dark-cell: if(@flavor = latte, @accent, @surface0); + @light-cell: @catppuccin[@mocha][@text]; + @dark-cell: @catppuccin[@mocha][@@accentColor]; @board: escape( '' @@ -612,8 +612,9 @@ & when (@styleBoardAndPieces = 1) { #board-play-computer, + .board.theme-selector-preview-board, .fade-in-overlay { - background-image: url("data:image/svg+xml,@{board}"); + background-image: url("data:image/svg+xml,@{board}") !important; } /* Coordinates - Inside */ @@ -629,55 +630,22 @@ } } - /* - The "Tatiana" piece set. - - Author: sadsnake1 - License: CC BY-NC-SA 4.0 (https://creativecommons.org/licenses/by-nc-sa/4.0/) - Source: https://github.com/sharechess/sharechess/tree/4f2f54c1340df59556f0f1d67e7b788c3322229c/public/pieces/tatiana - */ - - @white-piece-bg: if(@flavor = latte, @surface2, @text); - @black-piece-bg: if(@flavor = latte, @text, @surface2); - - @bishop: ''; - @king: ''; - @knight: ''; - @rook: ''; - @pawn: ''; - @queen: ''; - #piece(@piece, @type) { - @raw: if( - @type = "white", - replace( - replace( - replace( - replace(@piece, "%BORDER%", @mantle), - "%BG%", - @white-piece-bg - ), - "#fff", - @mantle - ), - "#000", - @text - ), - replace( - replace( - replace( - replace(@piece, "%BORDER%", @mantle), - "%BG%", - @black-piece-bg - ), - "#fff", - @text - ), - "#000", - @mantle - ) - ); - @svg: escape(@raw); + @border: @catppuccin[@mocha][@base]; + @darkest: if(@type = black, @catppuccin[@mocha][@base], @catppuccin[@mocha][@text]); + @darker: if(@type = black, @catppuccin[@mocha][@surface0], @catppuccin[@mocha][@subtext1]); + @main: if(@type = black, @catppuccin[@mocha][@surface1], @catppuccin[@mocha][@subtext0]); + @lighter: if(@type = black, @catppuccin[@mocha][@surface2], @catppuccin[@mocha][@overlay2]); + @lightest: if(@type = black, @catppuccin[@mocha][@overlay0], @catppuccin[@mocha][@overlay1]); + + @bishop: ''; + @king: ''; + @knight: ''; + @rook: ''; + @pawn: ''; + @queen: ''; + + @svg: escape(@@piece); @result: url("data:image/svg+xml,@{svg}"); } @@ -689,58 +657,58 @@ --theme-board-style-image: url("data:image/svg+xml,@{board}"); --theme-board-style-highlight-color: @highlight1; - --theme-piece-set-wp: #piece(@pawn, "white")[]; - --theme-piece-set-wn: #piece(@knight, "white")[]; - --theme-piece-set-wr: #piece(@rook, "white")[]; - --theme-piece-set-wb: #piece(@bishop, "white")[]; - --theme-piece-set-wq: #piece(@queen, "white")[]; - --theme-piece-set-wk: #piece(@king, "white")[]; - --theme-piece-set-bp: #piece(@pawn, "black")[]; - --theme-piece-set-bn: #piece(@knight, "black")[]; - --theme-piece-set-bb: #piece(@bishop, "black")[]; - --theme-piece-set-br: #piece(@rook, "black")[]; - --theme-piece-set-bq: #piece(@queen, "black")[]; - --theme-piece-set-bk: #piece(@king, "black")[]; + --theme-piece-set-wp: #piece(pawn, white)[]; + --theme-piece-set-wn: #piece(knight, white)[]; + --theme-piece-set-wr: #piece(rook, white)[]; + --theme-piece-set-wb: #piece(bishop, white)[]; + --theme-piece-set-wq: #piece(queen, white)[]; + --theme-piece-set-wk: #piece(king, white)[]; + --theme-piece-set-bp: #piece(pawn, black)[]; + --theme-piece-set-bn: #piece(knight, black)[]; + --theme-piece-set-bb: #piece(bishop, black)[]; + --theme-piece-set-br: #piece(rook, black)[]; + --theme-piece-set-bq: #piece(queen, black)[]; + --theme-piece-set-bk: #piece(king, black)[]; .piece { /* Black */ &.bp { - background-image: #piece(@pawn, "black")[] !important; + background-image: #piece(pawn, black)[] !important; } &.bn { - background-image: #piece(@knight, "black")[] !important; + background-image: #piece(knight, black)[] !important; } &.bb { - background-image: #piece(@bishop, "black")[] !important; + background-image: #piece(bishop, black)[] !important; } &.br { - background-image: #piece(@rook, "black")[] !important; + background-image: #piece(rook, black)[] !important; } &.bk { - background-image: #piece(@king, "black")[] !important; + background-image: #piece(king, black)[] !important; } &.bq { - background-image: #piece(@queen, "black")[] !important; + background-image: #piece(queen, black)[] !important; } /* White */ &.wp { - background-image: #piece(@pawn, "white")[] !important; + background-image: #piece(pawn, white)[] !important; } &.wn { - background-image: #piece(@knight, "white")[] !important; + background-image: #piece(knight, white)[] !important; } &.wb { - background-image: #piece(@bishop, "white")[] !important; + background-image: #piece(bishop, white)[] !important; } &.wr { - background-image: #piece(@rook, "white")[] !important; + background-image: #piece(rook, white)[] !important; } &.wk { - background-image: #piece(@king, "white")[] !important; + background-image: #piece(king, white)[] !important; } &.wq { - background-image: #piece(@queen, "white")[] !important; + background-image: #piece(queen, white)[] !important; } } }