[PRO-858] Theme API: data-driven E2E expectations per theme (design tokens) by qunabu · Pull Request #12239 · handsontable/handsontable
and others added 4 commits
March 30, 2026 14:04- Add figma token conversion tool at handsontable/src/themes/figma/ - Store design tokens JSON as tokens.json (single source of truth) - Tool outputs CSS and JS variable files directly to src/themes/static/ - Add npm script: npm run build:design-tokens - Use .mjs extensions for ES module support within CommonJS package - Absolute paths via import.meta.url for CWD-independent execution Workflow: Export tokens from Figma → save as tokens.json → run build:design-tokens Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- New test helper: designTokens.js resolves token references to numeric px values - Exported functions: token(), tokenForThemes(), getTokenValue(), calcRowHeight(), calcColHeaderHeight(), forAllThemes() - Token resolution chain: tokens → density → sizing → px value - Registered as global test helper via test/helpers/index.js Enables tests to calculate expected dimensions from design tokens instead of using hardcoded magic numbers per theme. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tests Convert .forThemes blocks in 16 test/e2e spec files to calculate expected dimensions from design tokens instead of using magic numbers. Formulas: calcRowHeight(t), calcColHeaderHeight(t), forAllThemes() - Row height = lineHeight + (cellVerticalPadding * 2) + 1px border - Col header height = lineHeight + (cellVerticalPadding * 2) Files converted: - fixedRowsBottom, fixedRowsTop, scrollToFocusedCell, scrollViewportTo - viewportScroll, refreshDimensions, batch, getRowHeight - ColHeader, Core_view, Core_resize, Core_reCreate - beforeViewportScrollVertically, modifyRowHeightByOverlayName - beforeRefreshDimensions, afterRefreshDimensions Note: 65 plugin spec files remain to be converted. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
qunabu
marked this pull request as ready for review
qunabu
marked this pull request as draft
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters