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:
@@ -66,6 +66,10 @@ function renderGrid(root, match) {
|
||||
const { width, height, terrain } = match.battlefield;
|
||||
root.setAttribute('data-bf-width', String(width));
|
||||
root.setAttribute('data-bf-height', String(height));
|
||||
// Set the column count via a CSS variable so the grid-template-columns
|
||||
// declaration can read it portably (CSS attr() for non-content properties
|
||||
// is not yet supported in Safari or Firefox as of mid-2026).
|
||||
root.style.setProperty('--bf-cols', String(width));
|
||||
|
||||
const unitsByKey = {};
|
||||
match.units.forEach((unit) => {
|
||||
|
||||
Reference in New Issue
Block a user