fix: add missing @property --db-screen-lg and update related CSS va…#6459
fix: add missing @property --db-screen-lg and update related CSS va…#6459
@property --db-screen-lg and update related CSS va…#6459Conversation
🦋 Changeset detectedLatest commit: 592ad36 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Pull request overview
This PR fixes an inconsistency in the foundations screen-size tokens by registering the missing @property --db-screen-lg, and adjusts the Tailwind v4 theme variable mappings for breakpoints and container sizes.
Changes:
- Register
--db-screen-lgvia@propertyso it has a typed definition and initial value like the other screen tokens. - Move Tailwind breakpoint definitions from hardcoded values to
var(--db-screen-*)mappings in the Tailwind theme dimensions file. - Add Tailwind
--container-*theme variables mapped to--db-container-*tokens, plus a patch changeset entry.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/foundations/tailwind/theme/revert-theme.css | Removes hardcoded Tailwind breakpoint values from the “revert” theme block. |
| packages/foundations/tailwind/theme/dimensions.css | Adds Tailwind breakpoint mappings and introduces --container-* variables mapped to DB container tokens. |
| packages/foundations/scss/_screen-sizes.scss | Adds the missing @property --db-screen-lg registration with an initial value. |
| .changeset/free-papers-boil.md | Adds a patch changeset documenting the fix. |
| --breakpoint-xs: var(--db-screen-xs); | ||
| --breakpoint-sm: var(--db-screen-sm); | ||
| --breakpoint-md: var(--db-screen-md); | ||
| --breakpoint-lg: var(--db-screen-lg); | ||
| --breakpoint-xl: var(--db-screen-xl); |
There was a problem hiding this comment.
--breakpoint-* theme values are used by Tailwind to generate responsive variants (e.g. sm:) via media queries. Setting them to var(--db-screen-*) risks Tailwind emitting @media (min-width: var(--db-screen-sm)), which is invalid because var() is not allowed in media queries. It also changes the actual breakpoint values vs the existing Tailwind v3 config (tailwind-tokens.json uses xs=360px, sm=720px, …). Prefer keeping literal lengths for --breakpoint-* here (and ensure they match the configured Tailwind screens) while still using --db-screen-* for spacing/sizing variables where var() is valid.
| --breakpoint-xs: var(--db-screen-xs); | |
| --breakpoint-sm: var(--db-screen-sm); | |
| --breakpoint-md: var(--db-screen-md); | |
| --breakpoint-lg: var(--db-screen-lg); | |
| --breakpoint-xl: var(--db-screen-xl); | |
| --breakpoint-xs: 360px; | |
| --breakpoint-sm: 720px; | |
| --breakpoint-md: 1024px; | |
| --breakpoint-lg: 1280px; | |
| --breakpoint-xl: 1440px; |
…riables
Proposed changes
Types of changes
Further comments
🔭🐙🐈 Test this branch here: https://design-system.deutschebahn.com/core-web/review/fix-missing-screen-property