Repository navigation
Conversation
Sass 1.95 deprecates the legacy if() function, so builds on it warn for every call left in `@carbon/motion`, `@carbon/styles` and the action set web component. Use `or` for the fallbacks in motion's error messages and @if/@else elsewhere, which every supported Sass version understands. The compiled CSS doesn't change. Signed-off-by: Alexey Kulakov <uni_que@me.com>
✅ Deploy Preview for v12-carbon-web-components ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for v12-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Thanks for your submission! We ask that you sign our Developer Certificate of Origin before we can accept your contribution. You can sign the DCO by adding a comment below using this text: I have read the DCO document and I hereby sign the DCO. You can retrigger this bot by commenting recheck in this Pull Request. Posted by the DCO Assistant Lite bot. |
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for v11-carbon-web-components ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Closes #24069
Sass 1.95 deprecates the legacy
if()function, and this replaces the eleven calls still left in@carbon/motion,@carbon/stylesand the action set web component. Motion's two error-message fallbacks useor; the rest use@if/@else, as #21305 did for tooltip. Both work in every Sass version@carbon/stylessupports (^1.33.0), which the newif(sass(...))syntax doesn't.Changelog
New
Changed
if()calls in motion's-validate-reveal, the card, popover, toggletip and tooltip styles, and the action set web component. The compiled CSS doesn't change.Removed
NoneTesting / Reviewing
packages/styles/index.scssbefore and after, withenable-v12-releaseoff and on. The CSS is byte-identical both ways, and the flag still changes the values these files set (the popover radius is 2px without it, 0.5rem with it).button-separatormixin gives the same CSS for its default, horizontal and vertical directions.$x or 'nothing'gives the same result asif($x, $x, 'nothing')for a string,nullandfalse, on sass 1.33.0 and 1.108.2.yarn jest packages/motion/__tests__/motion-test.jspasses, including the new case.@use '@carbon/motion';. The repo's lockfile has 1.93.2, which doesn't warn.PR Checklist
As the author of this PR, before marking ready for review, confirm you:
Updated documentation and storybook examples(nothing user-facing changes)Followed the required v12 migration documentation for any code change that affects v12, or struck through this item because the PR does not affect v12(the v12 output is unchanged)Addressed any impact on accessibility (a11y)(no visual or behaviour change)Tested for cross-browser consistency(identical CSS)More details can be found in the pull request guide.