Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(contextual-layout-tokens): support individual component style imports #13984

Merged
merged 6 commits into from
Jun 13, 2023

Conversation

janhassel
Copy link
Member

@janhassel janhassel commented Jun 13, 2023

Ref #13968

Closes #13986

Changelog

Changed

  • Imported layout module via @use from /styles/utilities/layout.scss to ensure tokens are always present when needed
  • Added ContainedList styles to build files
  • Added fallbacks for type properties used in contained-list.scss and button/mixin.scss
  • Improve isolated rendering of ContainedList (when only contained-list.scss is imported by the user)

Testing / Reviewing

Replace packages/react/.storybook/styles.scss with the following:

@use '../scss/components/accordion';
@use '../scss/components/button';
@use '../scss/components/contained-list';
@use '../scss/components/content-switcher';
@use '../scss/components/copy-button';
@use '../scss/components/progress-bar';
@use '../scss/components/tag';
@use '../scss/components/text-input';
@use '../scss/components/tile';
  • Verify the components supporting contextual layout tokens don't have any layout token-related regressions when imported without global styles:
    • Accordion
    • Button
    • ContainedList
    • ContentSwitcher
    • CopyButton
    • ProgressBar
    • Tag
    • TextInput
    • Tile
  • Verify the layout tokens are only emitted once in the generated packages/styles/css/styles.css

Note: With the isolated styles there are regressions in color caused by missing imports of the layer module. To contain the size of PRs this is not covered in this PR but should be handled in a separate one.

@janhassel janhassel requested a review from a team as a code owner June 13, 2023 08:04
@netlify
Copy link

netlify bot commented Jun 13, 2023

Deploy Preview for carbon-components-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 23125a1
🔍 Latest deploy log https://app.netlify.com/sites/carbon-components-react/deploys/648869487fcca0000882d4a4
😎 Deploy Preview https://deploy-preview-13984--carbon-components-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Jun 13, 2023

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 23125a1
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/6488694880c2160008c659c3
😎 Deploy Preview https://deploy-preview-13984--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Member

@tw15egan tw15egan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏🏻 Thanks for fixing this so quickly!

@kodiakhq kodiakhq bot merged commit 009bb31 into carbon-design-system:main Jun 13, 2023
@janhassel janhassel deleted the 13968-layout branch June 13, 2023 13:41
francinelucca pushed a commit to francinelucca/carbon that referenced this pull request Jun 13, 2023
…orts (carbon-design-system#13984)

* fix(contextual-layout-tokens): emit layout tokens if utilities are used

* fix: add contained-list styles to build files

* fix(contained-list): improve isolated rendering

* fix(button): add fallback to type token used in layout calc

* chore: update build files snapshot

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: broken padding for certain components in the official docs
3 participants