1
0
mirror of https://github.com/danbee/chess synced 2025-03-04 08:39:06 +00:00
chess/assets/css/_board.scss

62 lines
1.2 KiB
SCSS

.board {
border: 0.3vmin solid black;
margin: 0 auto;
width: 80vmin;
height: 80vmin;
}
.board-rank {
}
.board-square {
border: 0.2vmin solid $square-outline-color;
background-size: 100%;
background-repeat: no-repeat;
background-position: center;
@each $colour in $colours {
@each $piece in $pieces {
&.#{$colour}.#{$piece} {
background-image: url(/images/#{$piece}_#{$colour}.svg);
}
}
}
}
%black-square {
background-color: $black-square-color;
&.selected {
background-color: mix($black-square-color, $selected-square-color, 60%);
outline: 0.2vmin solid $selected-outline-color;
}
}
%white-square {
background-color: $white-square-color;
&.selected {
background-color: mix($white-square-color, $selected-square-color, 60%);
outline: 0.2vmin solid $selected-outline-color;
}
}
.board-rank:nth-child(odd) {
.board-square:nth-child(even) {
@extend %black-square;
}
.board-square:nth-child(odd) {
@extend %white-square;
}
}
.board-rank:nth-child(even) {
.board-square:nth-child(even) {
@extend %white-square;
}
.board-square:nth-child(odd) {
@extend %black-square;
}
}