1515.square ::before ,
1616.square ::after {
1717 position : absolute;
18- color : rgba (255 , 255 , 255 , 0.7 );
19- font-size : 0.8rem ;
18+ color : rgba (0 , 0 , 0 , 0.6 );
19+ font-size : 0.75rem ;
20+ font-weight : bold;
2021 z-index : 2 ;
2122 pointer-events : none;
23+ padding : 0 2px ;
24+ border-radius : 2px ;
25+ background-color : rgba (255 , 255 , 255 , 0.4 );
26+ line-height : 1 ;
27+ display : var (--show-coords , none);
28+ }
29+
30+ /* Adjust color specifically for dark squares */
31+ .square .dark ::before ,
32+ .square .dark ::after {
33+ color : rgba (255 , 255 , 255 , 0.7 );
34+ background-color : rgba (0 , 0 , 0 , 0.3 );
2235}
2336
24- /* File coordinates (a-h) */
25- .square [data-col = "0" ]::before {
26- content : 'a' ;
37+ /* File coordinates (a-h) - Positioned slightly inside */
38+ .square ::before {
2739 bottom : 2px ;
2840 left : 2px ;
29- display : var (--show-coords , none);
3041}
31- .square [data-col = "1" ]::before { content : 'b' ; bottom : 2px ; left : 2px ; display : var (--show-coords , none); }
32- .square [data-col = "2" ]::before { content : 'c' ; bottom : 2px ; left : 2px ; display : var (--show-coords , none); }
33- .square [data-col = "3" ]::before { content : 'd' ; bottom : 2px ; left : 2px ; display : var (--show-coords , none); }
34- .square [data-col = "4" ]::before { content : 'e' ; bottom : 2px ; left : 2px ; display : var (--show-coords , none); }
35- .square [data-col = "5" ]::before { content : 'f' ; bottom : 2px ; left : 2px ; display : var (--show-coords , none); }
36- .square [data-col = "6" ]::before { content : 'g' ; bottom : 2px ; left : 2px ; display : var (--show-coords , none); }
37- .square [data-col = "7" ]::before { content : 'h' ; bottom : 2px ; left : 2px ; display : var (--show-coords , none); }
38-
39- /* Rank coordinates (1-8) */
40- .square [data-row = "7" ][data-col = "7" ]::after { content : '1' ; top : 2px ; right : 2px ; display : var (--show-coords , none); }
41- .square [data-row = "6" ][data-col = "7" ]::after { content : '2' ; top : 2px ; right : 2px ; display : var (--show-coords , none); }
42- .square [data-row = "5" ][data-col = "7" ]::after { content : '3' ; top : 2px ; right : 2px ; display : var (--show-coords , none); }
43- .square [data-row = "4" ][data-col = "7" ]::after { content : '4' ; top : 2px ; right : 2px ; display : var (--show-coords , none); }
44- .square [data-row = "3" ][data-col = "7" ]::after { content : '5' ; top : 2px ; right : 2px ; display : var (--show-coords , none); }
45- .square [data-row = "2" ][data-col = "7" ]::after { content : '6' ; top : 2px ; right : 2px ; display : var (--show-coords , none); }
46- .square [data-row = "1" ][data-col = "7" ]::after { content : '7' ; top : 2px ; right : 2px ; display : var (--show-coords , none); }
47- .square [data-row = "0" ][data-col = "7" ]::after { content : '8' ; top : 2px ; right : 2px ; display : var (--show-coords , none); }
42+ .square [data-col = "0" ]::before { content : 'a' ; }
43+ .square [data-col = "1" ]::before { content : 'b' ; }
44+ .square [data-col = "2" ]::before { content : 'c' ; }
45+ .square [data-col = "3" ]::before { content : 'd' ; }
46+ .square [data-col = "4" ]::before { content : 'e' ; }
47+ .square [data-col = "5" ]::before { content : 'f' ; }
48+ .square [data-col = "6" ]::before { content : 'g' ; }
49+ .square [data-col = "7" ]::before { content : 'h' ; }
50+
51+ /* Rank coordinates (1-8) - Positioned slightly inside */
52+ .square ::after {
53+ top : 2px ;
54+ right : 2px ;
55+ }
56+ .square [data-row = "7" ]::after { content : '1' ; }
57+ .square [data-row = "6" ]::after { content : '2' ; }
58+ .square [data-row = "5" ]::after { content : '3' ; }
59+ .square [data-row = "4" ]::after { content : '4' ; }
60+ .square [data-row = "3" ]::after { content : '5' ; }
61+ .square [data-row = "2" ]::after { content : '6' ; }
62+ .square [data-row = "1" ]::after { content : '7' ; }
63+ .square [data-row = "0" ]::after { content : '8' ; }
64+
65+ /* Hide file coordinate on a1 and rank coordinate on h8 for less clutter */
66+ .square [data-row = "7" ][data-col = "0" ]::before { display : none !important ; }
67+ .square [data-row = "0" ][data-col = "7" ]::after { display : none !important ; }
4868
4969.square {
5070 display : flex;
109129 to { box-shadow : inset 0 0 20px rgba (255 , 0 , 0 , 0.8 ); }
110130}
111131
112- /* Last move indication */
113- .square .last-move-from {
114- background-color : rgba (173 , 216 , 230 , 0.3 );
132+ /* Last move indication - using corner markers */
133+ .square .last-move-from ::before ,
134+ .square .last-move-to ::before ,
135+ .square .last-move-from ::after ,
136+ .square .last-move-to ::after {
137+ content : '' ;
138+ position : absolute;
139+ width : 15% ;
140+ height : 15% ;
141+ background-color : rgba (70 , 130 , 180 , 0.7 ); /* Steel Blue */
142+ z-index : 1 ;
143+ }
144+
145+ /* Top-left corner */
146+ .square .last-move-from ::before {
147+ top : 0 ;
148+ left : 0 ;
149+ border-bottom-right-radius : 5px ;
150+ }
151+
152+ /* Bottom-right corner */
153+ .square .last-move-from ::after {
154+ bottom : 0 ;
155+ right : 0 ;
156+ border-top-left-radius : 5px ;
157+ }
158+
159+ /* Top-right corner */
160+ .square .last-move-to ::before {
161+ top : 0 ;
162+ right : 0 ;
163+ border-bottom-left-radius : 5px ;
115164}
116165
117- .square .last-move-to {
118- background-color : rgba (173 , 216 , 230 , 0.5 );
166+ /* Bottom-left corner */
167+ .square .last-move-to ::after {
168+ bottom : 0 ;
169+ left : 0 ;
170+ border-top-right-radius : 5px ;
119171}
0 commit comments