fix: declare grid-template-columns so the battle grid lays out as a grid, not a single column
CSS Grid without an explicit grid-template-columns defaults to a single-column layout, so the 64-144 tiles stacked vertically and the user saw a long column instead of an 8x8 (or 10x8 or 12x12) battlefield. Set the column count via a CSS variable on the grid root, written by match.js after the match snapshot loads (CSS attr() for non-content properties is not yet shipped in Safari or Firefox).
This commit is contained in:
@@ -20,7 +20,7 @@ table.bf-grid button[data-zone="bravo"] { outline: 3px solid #0c0; }
|
||||
.bf-errors { color: #c00; }
|
||||
.bf-toast { background: #dfd; padding: 0.5rem 1rem; margin: 0.5rem 0; }
|
||||
.bf-match { display: flex; gap: 1rem; }
|
||||
.bf-grid { display: grid; gap: 1px; background: #ddd; padding: 1px; width: max-content; }
|
||||
.bf-grid { display: grid; gap: 1px; background: #ddd; padding: 1px; width: max-content; grid-template-columns: repeat(var(--bf-cols, 8), 2.5rem); }
|
||||
.bf-tile { width: 2.5rem; height: 2.5rem; border: 0; background: #fff; padding: 0; position: relative; }
|
||||
.bf-tile[data-bf-terrain="forest"] { background: #cfc; }
|
||||
.bf-tile[data-bf-terrain="rough"] { background: #fec; }
|
||||
|
||||
Reference in New Issue
Block a user