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

[Feature Request] Split up the global style into required and opt in styling. #20100

Open
jellehak opened this issue Jul 4, 2024 · 3 comments
Assignees
Labels
sass T: enhancement Functionality that enhances existing features

Comments

@jellehak
Copy link

jellehak commented Jul 4, 2024

Problem to solve

Current vuetify global css includes a lot of optional selectors which in most use cases aren't used at all. It would be nice to opt in for these functionalities and keep this dry (and reduce bundle size).

Proposed solution

Split up the 'vuetify/styles' into smaller chunks like e.g.:

  • 'helpers.css' (paddings, margins, overflow, flex, text helpers, around 279 kB)
  • 'colors.css' (colors around 40 kB)
  • 'ress.css'
  • 'components.css' (this is one is a bit weird as the components already load its own style)

To be non breaking you can add the 'bare' essentials with someting like

import 'vuetify/core'

And opt in for the colors or helpers with

import 'vuetify/helpers' 
import 'vuetify/colors' 
@mandalornl
Copy link

@jellehak
Copy link
Author

@mandalornl Ok I didn't knew that seems a solution. The proposal is to make these opt in by not include the helpers in the pre builded css files by default. Since these aren't needed for proper working of Vuetify.

@TomDeSmet
Copy link

I'd really like this approach. The other option to disable using these utility classes requires us to install SASS as a dependency. I'm using PostCSS already and have no use of SASS, so it pains me that I need to have this dependency just to tell Vuetify I don't want to use its utility classes.

If I only want to use Vuetify's components, I would like to only load the CSS for the components without the use of a preprocessor.

@KaelWD KaelWD added T: enhancement Functionality that enhances existing features sass and removed S: triage labels Nov 4, 2024
@KaelWD KaelWD added this to the v4.0.0 (Revisionist) milestone Nov 4, 2024
@KaelWD KaelWD self-assigned this Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sass T: enhancement Functionality that enhances existing features
Projects
None yet
Development

No branches or pull requests

4 participants