$board-size: 90vmin; @mixin move-indicator { border-radius: 50%; content: ""; display: block; height: 2%; position: absolute; right: 2%; width: 2%; } .board { background: lighten($black-square-color, 7%); border-collapse: unset; border-radius: 2.8%; border-spacing: 1px; box-shadow: 0 ($board-size / 200) ($board-size / 40) $board-shadow-color; color: $white-square-color; display: flex; flex-direction: column; height: $board-size; position: relative; table-layout: fixed; width: $board-size; &.white-to-move::before { @include move-indicator; background: $white; } &.black-to-move::before { @include move-indicator; background: $black; } &.player-is-white.white-to-move::before, &.player-is-black.black-to-move::before { bottom: 2%; } &.player-is-white.black-to-move::before, &.player-is-black.white-to-move::before { top: 2%; } } .board-header, .board-footer { display: flex; flex-direction: row; } .board-border-bottom-middle { flex: 1; } .board-body { display: flex; flex: 1; flex-direction: row; .board-border-left, .board-border-right { height: 100%; } } .board-ranks { display: flex; flex: 1; flex-direction: column; } .board-rank { display: flex; flex: 1; } .board-border-left, .board-border-right { width: $board-size / 20; } .board-border-top, .board-border-bottom { height: $board-size / 20; } .board-square { background-position: center; background-repeat: no-repeat; background-size: 100%; border-radius: 2%; flex: 1; margin: 0.5px; // This is to ensure the squares can be clicked on in PhantomJS // TODO: Figure out why we need this min-height: 20px; min-width: 20px; @each $colour in $colours { @each $piece in $pieces { &.#{$colour}.#{$piece} { background-image: url(/images/#{$piece}_#{$colour}.svg); } } } } @mixin black-square { background-color: $black-square-color; &.selected { background-color: mix($black-square-color, $selected-square-color, 60%); box-shadow: 0 0 0 ($board-size / 400) $selected-outline-color; } &.available { background-color: mix($black-square-color, $available-square-color, 80%); box-shadow: 0 0 0 ($board-size / 400) $available-outline-color; } } @mixin white-square { background-color: $white-square-color; &.selected { background-color: mix($white-square-color, $selected-square-color, 60%); box-shadow: 0 0 0 ($board-size / 400) $selected-outline-color; } &.available { background-color: mix($white-square-color, $available-square-color, 80%); box-shadow: 0 0 0 ($board-size / 400) $available-outline-color; } } .board-rank:nth-child(odd) { .board-square:nth-child(even) { @include black-square; } .board-square:nth-child(odd) { @include white-square; } } .board-rank:nth-child(even) { .board-square:nth-child(even) { @include white-square; } .board-square:nth-child(odd) { @include black-square; } } @media (min-width: 480px) { .board-square { margin: 1px; } .board-label { font-size: 0.8rem; } } @media (min-width: 768px) { .board-square { margin: 1.5px; } .board-label { font-size: 1rem; } }