Skip to content

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

Merged
kodiakhq[bot] merged 6 commits into
carbon-design-system:mainfrom
janhassel:13968-layout
Jun 13, 2023
Merged

fix(contextual-layout-tokens): support individual component style imports#13984
kodiakhq[bot] merged 6 commits into
carbon-design-system:mainfrom
janhassel:13968-layout

Conversation

@janhassel

@janhassel janhassel commented Jun 13, 2023

Copy link
Copy Markdown
Member

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

netlify Bot commented Jun 13, 2023

Copy link
Copy Markdown

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

netlify Bot commented Jun 13, 2023

Copy link
Copy Markdown

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.

@tw15egan tw15egan left a comment

Copy link
Copy Markdown
Contributor

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