From 6a73faf008fb43aca07d5dbb29459c0e3c9fe577 Mon Sep 17 00:00:00 2001 From: Brock Date: Thu, 9 May 2024 10:50:53 -0400 Subject: [PATCH 1/3] improve coordinate color css --- assets/chessground.brown.css | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/assets/chessground.brown.css b/assets/chessground.brown.css index f23e87c8..a599c5e9 100644 --- a/assets/chessground.brown.css +++ b/assets/chessground.brown.css @@ -43,16 +43,20 @@ cg-board square.current-premove { } /** Alternating colors in rank/file/square labels */ -.cg-wrap coords:nth-child(odd) coord:nth-child(even), -.cg-wrap coords.squares:nth-child(even) coord:nth-child(odd), -.cg-wrap.orientation-black coords.files:nth-child(even) coord:nth-child(odd), -.cg-wrap coords.files:nth-child(even) coord:nth-child(even) { +.cg-wrap.orientation-white coords.ranks coord:nth-child(odd), +.cg-wrap.orientation-white coords.files coord:nth-child(even), +.cg-wrap.orientation-black coords.ranks coord:nth-child(even), +.cg-wrap.orientation-black coords.files coord:nth-child(odd), +.cg-wrap coords.squares:nth-of-type(odd) coord:nth-child(even), +.cg-wrap coords.squares:nth-of-type(even) coord:nth-child(odd) { color: rgba(72, 72, 72, 0.8); } -.cg-wrap coords:nth-child(odd) coord:nth-child(odd), -.cg-wrap coords.squares:nth-child(even) coord:nth-child(even), -.cg-wrap.orientation-black coords.files:nth-child(even) coord:nth-child(even), -.cg-wrap coords.files:nth-child(even) coord:nth-child(odd) { +.cg-wrap.orientation-white coords.ranks coord:nth-child(even), +.cg-wrap.orientation-white coords.files coord:nth-child(odd), +.cg-wrap.orientation-black coords.ranks coord:nth-child(odd), +.cg-wrap.orientation-black coords.files coord:nth-child(even), +.cg-wrap coords.squares:nth-of-type(odd) coord:nth-child(odd), +.cg-wrap coords.squares:nth-of-type(even) coord:nth-child(even) { color: rgba(255, 255, 255, 0.8); } From 7ae257f7f2598a3f5dd39ed5d70844b1dfcf823b Mon Sep 17 00:00:00 2001 From: Brock Date: Thu, 9 May 2024 14:57:54 -0400 Subject: [PATCH 2/3] more selector removing and nesting --- assets/chessground.base.css | 62 ++++++++++++++++++------------------ assets/chessground.brown.css | 24 +++++++------- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/assets/chessground.base.css b/assets/chessground.base.css index 6f7f7a7c..a8d003e9 100644 --- a/assets/chessground.base.css +++ b/assets/chessground.base.css @@ -173,7 +173,7 @@ piece.fading { transform: translateY(39%); } -.cg-wrap coords.squares { +coords.squares { bottom: 0; left: 0; text-transform: uppercase; @@ -181,44 +181,44 @@ piece.fading { flex-flow: column-reverse; height: 100%; width: 12.5%; -} -.cg-wrap coords.squares.black { - flex-flow: column; -} + &.black { + flex-flow: column; + } -.cg-wrap coords.squares.left { - text-align: left; -} + &.left { + text-align: left; + } -.cg-wrap coords.squares coord { - padding: 6% 4%; -} + coord { + padding: 6% 4%; + } -.cg-wrap coords.squares.rank2 { - transform: translateX(100%); -} + &.rank2 { + transform: translateX(100%); + } -.cg-wrap coords.squares.rank3 { - transform: translateX(200%); -} + &.rank3 { + transform: translateX(200%); + } -.cg-wrap coords.squares.rank4 { - transform: translateX(300%); -} + &.rank4 { + transform: translateX(300%); + } -.cg-wrap coords.squares.rank5 { - transform: translateX(400%); -} + &.rank5 { + transform: translateX(400%); + } -.cg-wrap coords.squares.rank6 { - transform: translateX(500%); -} + &.rank6 { + transform: translateX(500%); + } -.cg-wrap coords.squares.rank7 { - transform: translateX(600%); -} + &.rank7 { + transform: translateX(600%); + } -.cg-wrap coords.squares.rank8 { - transform: translateX(700%); + &.rank8 { + transform: translateX(700%); + } } diff --git a/assets/chessground.brown.css b/assets/chessground.brown.css index a599c5e9..79262af1 100644 --- a/assets/chessground.brown.css +++ b/assets/chessground.brown.css @@ -43,20 +43,20 @@ cg-board square.current-premove { } /** Alternating colors in rank/file/square labels */ -.cg-wrap.orientation-white coords.ranks coord:nth-child(odd), -.cg-wrap.orientation-white coords.files coord:nth-child(even), -.cg-wrap.orientation-black coords.ranks coord:nth-child(even), -.cg-wrap.orientation-black coords.files coord:nth-child(odd), -.cg-wrap coords.squares:nth-of-type(odd) coord:nth-child(even), -.cg-wrap coords.squares:nth-of-type(even) coord:nth-child(odd) { +.orientation-white .ranks :nth-child(odd), +.orientation-white .files :nth-child(even), +.orientation-black .ranks :nth-child(even), +.orientation-black .files :nth-child(odd), +coords.squares:nth-of-type(odd) :nth-child(even), +coords.squares:nth-of-type(even) :nth-child(odd) { color: rgba(72, 72, 72, 0.8); } -.cg-wrap.orientation-white coords.ranks coord:nth-child(even), -.cg-wrap.orientation-white coords.files coord:nth-child(odd), -.cg-wrap.orientation-black coords.ranks coord:nth-child(odd), -.cg-wrap.orientation-black coords.files coord:nth-child(even), -.cg-wrap coords.squares:nth-of-type(odd) coord:nth-child(odd), -.cg-wrap coords.squares:nth-of-type(even) coord:nth-child(even) { +.orientation-white .ranks :nth-child(even), +.orientation-white .files :nth-child(odd), +.orientation-black .ranks :nth-child(odd), +.orientation-black .files :nth-child(even), +coords.squares:nth-of-type(odd) :nth-child(odd), +coords.squares:nth-of-type(even) :nth-child(even) { color: rgba(255, 255, 255, 0.8); } From d8dc7891f8c597f36d2743822a3dc5bca977b54a Mon Sep 17 00:00:00 2001 From: Brock Date: Tue, 26 Nov 2024 10:30:15 -0500 Subject: [PATCH 3/3] reverted shortcuts --- assets/chessground.base.css | 62 ++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/assets/chessground.base.css b/assets/chessground.base.css index a8d003e9..6f7f7a7c 100644 --- a/assets/chessground.base.css +++ b/assets/chessground.base.css @@ -173,7 +173,7 @@ piece.fading { transform: translateY(39%); } -coords.squares { +.cg-wrap coords.squares { bottom: 0; left: 0; text-transform: uppercase; @@ -181,44 +181,44 @@ coords.squares { flex-flow: column-reverse; height: 100%; width: 12.5%; +} - &.black { - flex-flow: column; - } +.cg-wrap coords.squares.black { + flex-flow: column; +} - &.left { - text-align: left; - } +.cg-wrap coords.squares.left { + text-align: left; +} - coord { - padding: 6% 4%; - } +.cg-wrap coords.squares coord { + padding: 6% 4%; +} - &.rank2 { - transform: translateX(100%); - } +.cg-wrap coords.squares.rank2 { + transform: translateX(100%); +} - &.rank3 { - transform: translateX(200%); - } +.cg-wrap coords.squares.rank3 { + transform: translateX(200%); +} - &.rank4 { - transform: translateX(300%); - } +.cg-wrap coords.squares.rank4 { + transform: translateX(300%); +} - &.rank5 { - transform: translateX(400%); - } +.cg-wrap coords.squares.rank5 { + transform: translateX(400%); +} - &.rank6 { - transform: translateX(500%); - } +.cg-wrap coords.squares.rank6 { + transform: translateX(500%); +} - &.rank7 { - transform: translateX(600%); - } +.cg-wrap coords.squares.rank7 { + transform: translateX(600%); +} - &.rank8 { - transform: translateX(700%); - } +.cg-wrap coords.squares.rank8 { + transform: translateX(700%); }