Bundle design-tokens and webcorestylesheets with auro components #530
Replies: 1 comment 2 replies
-
Hi @ArcherScript The issue with your proposal is a maintenance problem. Due to the fact that all Auro components are using the ShadowDOM, installing all the tokens and CSS in with a component means a lot of duplication and when there are updates to either tokens or WCSS, then each element needs to be updated individually. The process as it exists today, when tokens and WCSS are updated, teams are only required to update those versions of the dependencies. The file references will be the same. No other component will require an update. Additionally, there is a side-effect of installing all the CSS in the web component unless it is fully server-side rendered. There will be a moment of unstyled content. Design tokens and WCSS should be listed as peer dependencies for all Auro components. As of "peerDependencies": {
"@aurodesignsystem/design-tokens": "^4.3.0",
"@aurodesignsystem/webcorestylesheets": "^5.0.8"
}, Just FYI, using Tokens and WCSS for base install doesn't require Sass. You can reference the following files once in your app primary HTML template. This is only required to be set up once. Sass does not require that CSS custom properties are installed in the Sass files for processing.
Everything after those baseline files will be contained within the web component. Other Sass files are à la carte to fit your app's needs. ProposalAll this being said, there is a proposal for adding these types of CSS files to an outer-most wrapping element, but we still have the flash of unstyled content issues unless you are fully server-side rendering a first pass of the UI. Full ESM compatibility is something that the team is working on. https://github.com/orgs/AlaskaAirlines/discussions/502 |
Beta Was this translation helpful? Give feedback.
-
Is it possible to bundle all of the css required for a component with the component itself?
Starting a project that uses auro I have to
Is it possible to make it so that components have access to the styled variables they need without having to rely on a dependency of design-tokens and webcorestylesheets? It would be amazing if we could be in a position where using auro was just a matter of:
Beta Was this translation helpful? Give feedback.
All reactions