Skip to content

refactor(css): systematize z-index with semantic tokens#12751

Open
Armansiddiqui9 wants to merge 2 commits into
internetarchive:masterfrom
Armansiddiqui9:refactor/z-index-semantic-tokens
Open

refactor(css): systematize z-index with semantic tokens#12751
Armansiddiqui9 wants to merge 2 commits into
internetarchive:masterfrom
Armansiddiqui9:refactor/z-index-semantic-tokens

Conversation

@Armansiddiqui9
Copy link
Copy Markdown
Contributor

Closes #12363

refactor: Systematize z-index with semantic tokens

Addresses the "token system" workstream of issue #12363 by:

  • Renaming numeric primitives (level-1, level-14, etc.) to semantic tokens (behind, base, raised, sticky, fixed, dropdown, modal, overlay, toast)
  • Removing unused level-6 and level-7 primitives per intentional gaps policy
  • Documenting the semantic scale and stacking hierarchy inline
  • Clarifying rules: token-only usage, isolation: isolate for layering components, Popover API preference for new overlays

Technical

All 9 semantic tokens map to existing primitive values (no visual regressions). The token file now serves as the single source of truth for z-index hierarchy. Stylelint already enforces token-only usage via scale-unlimited/declaration-strict-value rule.

Deferred to follow-up PRs (per issue checklist):

  • Replace hardcoded z-index values (plot.js, SelectionManager.css)
  • Remove !important from ui-dialog.css and legacy-jquery-ui.css
  • Add isolation: isolate to 5 components (.list-follow-card, .list-card, .rating-form .stars, .mybooks-details, .editionCover)

Testing

  • Verify no CSS regressions: npm test or visual QA on existing components
  • Confirm Stylelint accepts all token usage and rejects raw z-index values

Screenshot

Stakeholders

@lokesh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DRAFT: Systematize z-index usage across the site

2 participants