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

Elements packages docs are confusing #16985

Open
4 tasks
tay1orjones opened this issue Jul 17, 2024 · 2 comments
Open
4 tasks

Elements packages docs are confusing #16985

tay1orjones opened this issue Jul 17, 2024 · 2 comments

Comments

@tay1orjones
Copy link
Member

tay1orjones commented Jul 17, 2024

The landscape of our elements packages leads to a lot of confusion.

Click to expand a chart of the current landscape

graph LR
   

    CarbonReact("@carbon/react")
    CarbonStyles("@carbon/styles")
    OnlyStyles(("Only includes </br>styles/sass modules </br>from these packages, </br>no js exports"))

    CarbonIcons("@carbon/icons")
    CarbonIconsReact("@carbon/icons-react")

    CarbonElements("@carbon/elements")

    subgraph "&quot;Elements&quot; packages"
    CarbonColors("@carbon/colors")
    CarbonGrid("@carbon/grid")
    CarbonLayout("@carbon/layout")
    CarbonMotion("@carbon/motion")
    CarbonThemes("@carbon/themes")
    CarbonType("@carbon/type")
    end

    

    CarbonStyles --> CarbonReact

    CarbonColors --> OnlyStyles
    CarbonGrid   --> OnlyStyles
    CarbonLayout --> OnlyStyles
    CarbonMotion --> OnlyStyles
    CarbonThemes --> OnlyStyles
    CarbonType   --> OnlyStyles
    OnlyStyles   --> CarbonStyles

    CarbonColors --> CarbonElements
    CarbonGrid   --> CarbonElements
    CarbonLayout --> CarbonElements
    CarbonMotion --> CarbonElements
    CarbonThemes --> CarbonElements
    CarbonType   --> CarbonElements

    CarbonIconsReact --> CarbonReact
    CarbonIcons --> CarbonIconsReact

Loading

This does not include the additional complexity of what types of assets are provided through each package. Elements packages for instance sometimes contain js and/or sass exports. What exactly they export is not well documented.

Points of confusion

  • When would a dev need to install @carbon/elements?
  • When would a dev need to install @carbon/colors or @carbon/grid or ... etc. for all elements packages
  • What's included in an elements package? Styles? JS Exports?
  • Why are tokens listed on the color tokens documentation page different than what's actually exported from @carbon/colors? When/why do I use @carbon/themes with/instead of @carbon/colors
  • What parts of the elements packages are available through @carbon/styles?
    • When/why would I install @carbon/colors (or any other elements package) alongside @carbon/styles?
  • How does @carbon/react play into all of this?
    • When/why would I install @carbon/colors (or any other elements package) alongside @carbon/react?
  • ... what else?

Proposal

To try and improve this situation I think we could explore the following ideas to be more clear in the documentation.

Tasks

Preview Give feedback
Copy link
Contributor

Thank you for submitting a feature request. Your proposal is open and will soon be triaged by the Carbon team.

If your proposal is accepted and the Carbon team has bandwidth they will take on the issue, or else request you or other volunteers from the community to work on this issue.

@tay1orjones
Copy link
Member Author

tay1orjones commented Jul 18, 2024

One additional suggestion:

Just have docs explain every way you can import smtn like myColor can either be imported by import @carbon/react, import @carbon/color||style , or use @carbon/color||style/scss/myColor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Later 🧊
Development

No branches or pull requests

2 participants