Open lee-chase opened 3 months ago
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.
Hey! Thanks for writing this down, there are some interesting ideas here. Some quick thoughts:
Since interoperable css isn't on a standards track and isn't supported by sass, I think the only available way to get tokens and mixins into a js environment is by using the sass javascript api directly. We have some tests that do this actually:
Hey @tay1orjones assuming all values are output, then suitable documentation ticks most boxes for either JS in CSS and direct access to custom css properties ticks most boxes for non-SASS users. That does need to include, how to instantiate custom css properties like --cds-productive-01-font-size
.
Not sold on utility classes myself, too easy to accidentally override, but do provide an non-sass way of collecting multiple CSS settings.
The problem
Carbon uses SCSS to generate it's CSS. Use of CSS in JS, Less or other technique to apply Carbon is not always possible. This is a block to Carbonisation in some cases.
Currently some Carbon tokens can be accessed as Custom CSS properties, but this does not include all values e.g. motion easings.
The custom properties are not well documented including the mechanisms for instantiating them. For example type mixins make use of custom css properties, but it is not clear how these are instantiated in CSS.
Mixins can be discovered through inspection of the Javascript imports, and recreated. These mixins could be available as CSS classes e.g.
.productive-heading-04
.The solution
Examples
No response
Application/PAL
No response
Business priority
Medium Priority = upcoming release but is not pressing
Available extra resources
No response
Code of Conduct