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

Make Sass components self-contained to improve performance #83

Open
certainlyakey opened this issue Apr 19, 2023 · 1 comment
Open

Make Sass components self-contained to improve performance #83

certainlyakey opened this issue Apr 19, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@certainlyakey
Copy link
Contributor

Summary

Right now it is impossible to import just a couple of Sass components from the library to your app without anything else. Because Sass' @import rule is used in the library, when importing a specific Sass component in a consumer app you would also need to import a number of dependent Sass files. Those dependencies are different for each component and are not specified explicitly.

We need the styling components to be self-contained and independent from each other. Importing a component file would automatically bring all the dependencies (possibly not only Sass dependencies, but also CSS variables if those are used).

Ideally a consumer app would need to go an "import-all" strategy only in case it really needs all the components at once.

This will help to reduce bundle size and improve performance – a consumer app would only load the parts of the library it needs.

What alternatives have you tried?

No response

Does this feature request involve any updates to the reference design?

No

Implementation details

Every Sass component would @use all of its dependencies. Splitting some of the existing Sass dependencies (eg colors.scss) might be necessary.

@certainlyakey certainlyakey added the enhancement New feature or request label Apr 19, 2023
@certainlyakey
Copy link
Contributor Author

This could help consuming apps to import just what they need. Eg. right now it is not possible to @use a cvi-breakpoint-up() mixin from CVI in a consuming app because that one doesn't @use variables it depends on directly but instead just assumes they are in global scope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant