feat(chess.com): add option to style board & pieces (#1761)

Co-authored-by: uncenter <[email protected]>
Co-authored-by: isabel <[email protected]>
This commit is contained in:
authored and GitHub committed 2025-06-04 14:43:53 +01:00
1 parent af7b349063
commit 21010f21fc
1 file changed
+13 -5
+13 -5
View File
@@ -18,6 +18,7 @@
@var select highlightColor2 "Highlight 2" ["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 highlightColor2 "Highlight 2" ["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 highlightColor3 "Highlight 3" ["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 highlightColor3 "Highlight 3" ["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 highlightColor4 "Highlight 4" ["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 highlightColor4 "Highlight 4" ["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 styleBoardAndPieces "Style Board & Pieces" 1
==/UserStyle== */ ==/UserStyle== */
@-moz-document domain("chess.com") { @-moz-document domain("chess.com") {
@@ -283,6 +284,7 @@
--textColor: @text; --textColor: @text;
--arrowColor: @subtext0; --arrowColor: @subtext0;
} }
.ui_pagination-item-component { .ui_pagination-item-component {
--paginationColor: @text; --paginationColor: @text;
--paginationBgColor: @surface1; --paginationBgColor: @surface1;
@@ -497,6 +499,7 @@
background-color: @surface1; background-color: @surface1;
} }
.arrow { .arrow {
&[style*="rgba(248, 85, 63, 0.8)"] { &[style*="rgba(248, 85, 63, 0.8)"] {
fill: @highlight1 !important; fill: @highlight1 !important;
@@ -592,7 +595,6 @@
.popup-component { .popup-component {
background-color: @surface0; background-color: @surface0;
color: @text; color: @text;
&.popup-left .popup-arrow { &.popup-left .popup-arrow {
border-left-color: @surface0; border-left-color: @surface0;
} }
@@ -643,6 +645,7 @@
'<svg width="1600" height="1600" viewBox="0 0 1600 1600" xmlns="http://www.w3.org/2000/svg"><path fill="@{dark-cell}" d="M200 0v200h200V0Zm200 200v200h200V200Zm200 0h200V0H600Zm200 0v200h200V200Zm200 0h200V0h-200Zm200 0v200h200V200Zm200 0h200V0h-200zm0 200v200h200V400zm0 200h-200v200h200zm0 200v200h200V800Zm0 200h-200v200h200zm0 200v200h200v-200zm0 200h-200v200h200zm-200 0v-200h-200v200zm-200 0H800v200h200zm-200 0v-200H600v200zm-200 0H400v200h200zm-200 0v-200H200v200zm-200 0H0v200h200zm0-200v-200H0v200zm0-200h200V800H200Zm0-200V600H0v200zm0-200h200V400H200Zm0-200V200H0v200zm200 200v200h200V600Zm200 0h200V400H600Zm200 0v200h200V600Zm200 0h200V400h-200Zm0 200v200h200V800Zm0 200H800v200h200zm-200 0V800H600v200zm-200 0H400v200h200z"/><path fill="@{light-cell}" d="M0 0v200h200V0Zm200 200v200h200V200Zm200 0h200V0H400zm200 0v200h200V200Zm200 0h200V0H800Zm200 0v200h200V200Zm200 0h200V0h-200zm200 0v200h200V200Zm0 200h-200v200h200zm0 200v200h200V600Zm0 200h-200v200h200zm0 200v200h200v-200Zm0 200h-200v200h200zm0 200v200h200v-200zm-200 0h-200v200h200zm-200 0v-200H800v200zm-200 0H600v200h200zm-200 0v-200H400v200zm-200 0H200v200h200zm-200 0v-200H0v200zm0-200h200v-200H200Zm0-200V800H0v200zm0-200h200V600H200Zm0-200V400H0v200zm200 0h200V400H400zm200 0v200h200V600Zm200 0h200V400H800Zm200 0v200h200V600Zm0 200H800v200h200zm0 200v200h200v-200Zm-200 0H600v200h200zm-200 0V800H400v200z"/></svg>' '<svg width="1600" height="1600" viewBox="0 0 1600 1600" xmlns="http://www.w3.org/2000/svg"><path fill="@{dark-cell}" d="M200 0v200h200V0Zm200 200v200h200V200Zm200 0h200V0H600Zm200 0v200h200V200Zm200 0h200V0h-200Zm200 0v200h200V200Zm200 0h200V0h-200zm0 200v200h200V400zm0 200h-200v200h200zm0 200v200h200V800Zm0 200h-200v200h200zm0 200v200h200v-200zm0 200h-200v200h200zm-200 0v-200h-200v200zm-200 0H800v200h200zm-200 0v-200H600v200zm-200 0H400v200h200zm-200 0v-200H200v200zm-200 0H0v200h200zm0-200v-200H0v200zm0-200h200V800H200Zm0-200V600H0v200zm0-200h200V400H200Zm0-200V200H0v200zm200 200v200h200V600Zm200 0h200V400H600Zm200 0v200h200V600Zm200 0h200V400h-200Zm0 200v200h200V800Zm0 200H800v200h200zm-200 0V800H600v200zm-200 0H400v200h200z"/><path fill="@{light-cell}" d="M0 0v200h200V0Zm200 200v200h200V200Zm200 0h200V0H400zm200 0v200h200V200Zm200 0h200V0H800Zm200 0v200h200V200Zm200 0h200V0h-200zm200 0v200h200V200Zm0 200h-200v200h200zm0 200v200h200V600Zm0 200h-200v200h200zm0 200v200h200v-200Zm0 200h-200v200h200zm0 200v200h200v-200zm-200 0h-200v200h200zm-200 0v-200H800v200zm-200 0H600v200h200zm-200 0v-200H400v200zm-200 0H200v200h200zm-200 0v-200H0v200zm0-200h200v-200H200Zm0-200V800H0v200zm0-200h200V600H200Zm0-200V400H0v200zm200 0h200V400H400zm200 0v200h200V600Zm200 0h200V400H800Zm200 0v200h200V600Zm0 200H800v200h200zm0 200v200h200v-200Zm-200 0H600v200h200zm-200 0V800H400v200z"/></svg>'
); );
& when (@styleBoardAndPieces = 1) {
#board-play-computer, #board-play-computer,
.fade-in-overlay { .fade-in-overlay {
background-image: url("data:image/svg+xml,@{board}"); background-image: url("data:image/svg+xml,@{board}");
@@ -655,6 +658,8 @@
fill: @light-cell; fill: @light-cell;
} }
}
/* /*
The "Tatiana" piece set. The "Tatiana" piece set.
@@ -707,6 +712,12 @@
@result: url("data:image/svg+xml,@{svg}"); @result: url("data:image/svg+xml,@{svg}");
} }
.board-popover-component {
background-color: @surface0;
}
& when (@styleBoardAndPieces = 1) {
--theme-board-style-image: url("data:image/svg+xml,@{board}"); --theme-board-style-image: url("data:image/svg+xml,@{board}");
--theme-board-style-highlight-color: @highlight1; --theme-board-style-highlight-color: @highlight1;
@@ -723,10 +734,6 @@
--theme-piece-set-bq: #piece(@queen, "black")[]; --theme-piece-set-bq: #piece(@queen, "black")[];
--theme-piece-set-bk: #piece(@king, "black")[]; --theme-piece-set-bk: #piece(@king, "black")[];
.board-popover-component {
background-color: @surface0;
}
.piece { .piece {
/* Black */ /* Black */
&.bp { &.bp {
@@ -768,6 +775,7 @@
background-image: #piece(@queen, "white")[] !important; background-image: #piece(@queen, "white")[] !important;
} }
} }
}
.chessboard-pkg-move-list-component .dark-row { .chessboard-pkg-move-list-component .dark-row {
background-color: @surface1; background-color: @surface1;