Font and icon asset setup
Documents how WarGrid's icon and font assets are packaged and served. This covers the default icon set format (SVG sprite or icon font), where the files live in the package, configuring the asset base path for self-hosting or CDNs, bundler handling of asset URLs, offline/intranet deployment, preloading, CORS and CSP requirements for fonts, and what happens if assets fail to load. Swapping individual icons remains in…
Planned. This page shows the specification from issue #211. The live example, source for every framework and the API reference replace it when the feature ships.
Live example
A grid with sort, filter, menu and tree-expand icons visible, loading assets from the default path.
Expected behavior
Valid paths render all icons. The broken path triggers assetLoadError, the grid falls back to text glyphs, and the demo panel shows the failing URL. Switching to inline-svg makes zero network requests for icons.
Planned API surface
gridOptions.assets.basePath: stringgridOptions.assets.iconMode: 'svg-sprite' | 'inline-svg' | 'font'CSS custom property --wg-icon-font-familyPackage paths: /assets/icons.svg, /assets/fonts/*.woff2Event: assetLoadError { asset, url }Acceptance criteria
- All asset files and their package paths are listed (pending)
- basePath change takes effect for newly created grids and is documented as such (pending)
- Bundler recipes (Vite, webpack) show copying or importing assets (pending)
- Font CORS headers and CSP font-src/img-src requirements are documented (pending)
- Fallback glyphs keep controls usable when assets fail (pending)
- inline-svg mode documented as the zero-request option for strict environments (pending)