feat(Dialog): Add design tokens for border radius and box shadow#2429
Closed
VincentSmedinga wants to merge 11 commits intodevelopfrom
Closed
feat(Dialog): Add design tokens for border radius and box shadow#2429VincentSmedinga wants to merge 11 commits intodevelopfrom
VincentSmedinga wants to merge 11 commits intodevelopfrom
Conversation
# Conflicts: # packages-proprietary/tokens/src/components/ams/dialog.tokens.json
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds community-facing design token support for border-radius and box-shadow in the Dialog component, and refactors the Style Dictionary build pipeline to better support DTCG-compliant shadow/dimension token shapes while excluding Amsterdam-unwanted tokens from published outputs.
Changes:
- Add
--ams-dialog-border-radiusand--ams-dialog-box-shadowhooks in Dialog CSS (withinitialfallback). - Introduce DTCG shadow/dimension normalization utilities and update multiple component tokens to declare
"$type": "shadow"forbox-shadow. - Refactor the tokens build script by extracting transforms/filters into separate modules and applying an exclusion filter across outputs.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/css/src/components/dialog/dialog.scss | Adds border-radius/box-shadow declarations using token custom properties with initial fallback. |
| packages-proprietary/tokens/style-dictionary/transforms/shadow-dtcg-dimension-normalize.js | Adds a transform to convert shadow sub-value dimension objects to CSS strings prior to shadow/css/shorthand. |
| packages-proprietary/tokens/style-dictionary/transforms/name-custom-kebab.js | Extracts custom kebab-case naming transform (strips trailing default). |
| packages-proprietary/tokens/style-dictionary/transforms/name-custom-camel.js | Extracts custom camelCase naming transform (strips trailing default). |
| packages-proprietary/tokens/style-dictionary/transforms/dtcg-dimension.js | Extracts DTCG dimension-to-string value transform using shared helper. |
| packages-proprietary/tokens/style-dictionary/filters/ams-exclude.js | Adds filter to exclude tokens marked via $extensions.nl.amsterdam.exclude. |
| packages-proprietary/tokens/style-dictionary/dimensionToString.js | Adds shared helper to stringify DTCG dimension objects. |
| packages-proprietary/tokens/src/components/ams/text-area.tokens.json | Marks box-shadow tokens as "$type": "shadow" for proper shadow handling. |
| packages-proprietary/tokens/src/components/ams/tabs.tokens.json | Converts tab shadows to structured DTCG shadow objects (notably includes calc() offsets). |
| packages-proprietary/tokens/src/components/ams/search-field.tokens.json | Marks box-shadow tokens as "$type": "shadow". |
| packages-proprietary/tokens/src/components/ams/password-input.tokens.json | Marks box-shadow tokens as "$type": "shadow". |
| packages-proprietary/tokens/src/components/ams/dialog.tokens.json | Adds border-radius and box-shadow tokens (excluded from Amsterdam output). |
| packages-proprietary/tokens/src/components/ams/date-input.tokens.json | Marks box-shadow tokens as "$type": "shadow". |
| packages-proprietary/tokens/src/components/ams/button.tokens.json | Converts button hover box-shadow to structured DTCG shadow object. |
| packages-proprietary/tokens/src/common/ams/inputs.tokens.json | Converts shared input hover/invalid hover box-shadow to structured DTCG shadow objects. |
| packages-proprietary/tokens/build.js | Registers extracted transforms/filters, applies exclusion filter to outputs, and adds common transform chain including shadow normalization/shorthand. |
| packages-proprietary/tokens/README.md | Documents the new $extensions.nl.amsterdam.exclude mechanism and CSS fallback pattern. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5 tasks
Contributor
Author
|
Closing this to separate concerns into dedicated PRs. |
5 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the pull request
Thank you for contributing to the project!
Please use this template to help us handle your PR smoothly.
What
border-radiusandbox-shadowto our Dialog component.Why
How
dimensiontype (an object withvalueandunitproperties) that the DTCG specification requires for the values of the CSSbox-shadowproperty. So the first step was to add a transformer (shadowDTCGDimensionNormalize) so that we can keep following the specfication for our token definitions. It uses a simpledimensionToStringfunction that I could later on reuse in our existingdtcgDimensiontransform."$type": "shadow"to our existing tokens forbox-shadow, and specified the subtokens for ourinputsandbuttontokens.$extensionproperties to exclude them.initialto theirvar()custom property calls, or else ourvalue-no-unknown-custom-propertiesrule of Stylelint would object against an unexpected custom property. So we won’t be able to shave off these lines of CSS. As we’ll probably add more tokens we don’t use ourselves in the future, to support the community, the approach will still save some weight in the tokens stylesheet.Checklist
Before submitting your pull request, please ensure you have done the following. Check each checkmark if you have done so or if it wasn't necessary:
Additional notes