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

Add @carbon/ibm-products style import examples in docs #3497

Closed
3 of 5 tasks
gabyrfp opened this issue Sep 22, 2023 · 7 comments
Closed
3 of 5 tasks

Add @carbon/ibm-products style import examples in docs #3497

gabyrfp opened this issue Sep 22, 2023 · 7 comments
Assignees
Labels
type: docs 📖 Improvements or additions to documentation

Comments

@gabyrfp
Copy link

gabyrfp commented Sep 22, 2023

Carbon-ibm-products overrides carbon-react styling

What package(s) are you using?

  • Carbon for IBM Products (or Carbon for IBM Cloud & Cognitive)
  • Carbon React
  • Carbon Styles
  • Legacy/CDAI
  • Legacy/Security

Detailed description

Describe in detail the issue you're having.

Is this issue related to a specific component?

What did you expect to happen? What happened instead? What would you like to
see changed?

What browser are you working in?

What version of the @carbon/ibm-products (or @carbon/ibm-cloud-cognitive)
package are you using?

What offering/product do you work on? Any pressing ship or release dates we
should be aware of?

I am working with @carbon/react components and one @carbon/ibm-products component (tearsheet). To get the styling for the tearsheet, I added @use '@carbon/ibm-products/scss/index'; to my global style file which contains other Carbon styles. Doing this makes my tearsheet look right, but the other components in my app like the elements in my Carbon header bar and my Carbon table now have warped styling:

image
image

The first screenshot shows the styling of my carbon react components without the import from ibm-products and the second is with.

I tried using @use '@carbon/ibm-products/scss/index-without-carbon.scss' as well, but that didn't change anything.

Steps to reproduce the issue

  1. Step one
  2. Step two
  3. Step three
  4. etc.

Please create a reduced test case in CodeSandbox

https://codesandbox.io/s/github/carbon-design-system/ibm-products/tree/main/examples/carbon-for-ibm-products/SidePanel

  1. Create a carbon react project with the recommended styling file
  2. Add a carbon/ibm-products component and add the line @use '@carbon/ibm-products/scss/index-without-carbon.scss' to the original carbon styling file
  3. You will see the carbon react components now have warped styling.

Additional information

  • Screenshots or code
  • Notes
@kevinquinnw
Copy link

kevinquinnw commented Oct 3, 2023

Hey I am the having the same problem as well, I am currently on:

"@carbon/ibm-products": "^2.10.2",
"@carbon/react": "^1.37.0"
"sass": "1.64.2"

I am glad I am not the only one with this problem!

@gabyrfp
Copy link
Author

gabyrfp commented Oct 3, 2023

I was able to resolve this issue by using @use '@carbon/ibm-products/scss/index-full-carbon'; This should be added to the documentation as the styling required for using @carbon/react alongside @carbon/ibm-products

@kevinquinnw
Copy link

Thanks so much for figuring this out! Couldn't find this information anywhere

@elycheea
Copy link
Contributor

elycheea commented Oct 5, 2023

Hey, thanks for reaching out about this. We can review our docs to ensure that this is reflected more clearly.

@elycheea elycheea changed the title Carbon-ibm-products overrides carbon-react styling Add @carbon/ibm-products style import examples in docs Oct 5, 2023
@elycheea elycheea added the type: docs 📖 Improvements or additions to documentation label Oct 5, 2023
@lee-chase
Copy link
Member

Not sure what was happening here and it is tricky to figure out without example code. It certainly should not be necessary to import @carbon/ibm-products/scss/index-full-carbon.

Ordinarily i use

@use "@carbon/react" with (
  $font-path: "@ibm/plex"
);
@use "@carbon/ibm-products/css/index-without-carbon";

If anyone is still suffering from this issue @elycheea then please ask them to modify this CodeSandbox to demonstrate the issue. Otherwise I would close the issue.

https://codesandbox.io/p/devbox/carbon-and-ibm-products-import-t4l4wv?file=%2Fsrc%2Findex.scss

@ljcarot
Copy link
Member

ljcarot commented Sep 16, 2024

@elycheea okay to close ?

@elycheea
Copy link
Contributor

@ljcarot Yes. Let’s close this. We added a section on including styles in the Developing section of the new website too. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: docs 📖 Improvements or additions to documentation
Projects
Status: Done 🚀
Development

No branches or pull requests

5 participants