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

[Bug]: Custom component button token has errors #11853

Closed
2 tasks done
lidongyangLeo opened this issue Jul 25, 2022 · 1 comment
Closed
2 tasks done

[Bug]: Custom component button token has errors #11853

lidongyangLeo opened this issue Jul 25, 2022 · 1 comment

Comments

@lidongyangLeo
Copy link
Collaborator

Package

@carbon/react

Browser

Chrome

Package version

1.8.0

React version

17.0.2

Description

As this doc
https://github.com/carbon-design-system/carbon/blob/main/packages/styles/docs/sass.md#components
I use this code custom button token, but this has errrors.

@use '@carbon/react/scss/components/button' with (
 $button-primary: #017f75
);

errors

This module was already loaded, so it can't be configured using "with".
  ┌──> node_modules/@carbon/styles/scss/components/button/_index.scss
10│   @forward 'tokens';
  │   ^^^^^^^^^^^^^^^^^ new load
  ╵
  ┌──> node_modules/@carbon/styles/scss/components/button/_mixins.scss
17│   @use 'tokens' as *;
  │   ━━━━━━━━━━━━━━━━━━ original load
  ╵
  ┌──> stdin
1 │ ┌ @use '@carbon/react/scss/components/button' with (
2 │ │   $button-primary: #017f75,
3 │ │ );
  │ └─^ configuration
  ╵
  node_modules/@carbon/styles/scss/components/button/_index.scss 10:1  @forward
  node_modules/@carbon/react/scss/components/button/_index.scss 9:1    @use
  stdin 1:1                                                            root stylesheet

Reproduction/example

https://stackblitz.com/edit/github-bqtelk?file=src/index.scss

Steps to reproduce

only use
@use '@carbon/react/scss/components/button' with ($button-primary: #017f75);
has errors.

Code of Conduct

@tay1orjones
Copy link
Member

Closed via #11912

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants