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

[Bug Report][3.4.6] Disabling utility classes breaks some components blueprints and styling #18846

Open
mcfarljw opened this issue Dec 10, 2023 · 8 comments
Labels
sass T: bug Functionality that does not work as intended/expected

Comments

@mcfarljw
Copy link

mcfarljw commented Dec 10, 2023

Environment

Vuetify Version: 3.4.6
Vue Version: 3.3.11
Browsers: Chrome 120.0.0.0
OS: Mac OS 10.15.7

Steps to reproduce

  1. Clone https://github.com/mcfarljw/vuetify-disabled-class-utilities
  2. Run npm i
  3. Run npm run dev

Expected Behavior

Disabling utility classes doesn't break the default Vuetify components.

  • VBtn should be rounded with a cursor on hover
  • VTab should use the correct colors with a cursor when hovering and be rounded
  • VNavigationDrawer should not have a border

Actual Behavior

Disabling utility classes cases several components to not be styled correctly.

  • VBtn is not rounded without a cursor on hover
  • VTab is not the correct color when hovering and is not rounded
  • VNavigationDrawer has a border despite it being set to 0

Reproduction Link

https://github.com/mcfarljw/vuetify-disabled-class-utilities

Other comments

In general I've been having a lot of trouble following the documentation for SASS Variables (https://vuetifyjs.com/en/features/sass-variables). I'm trying to disable the utility classes so that I can use TailwindCSS, UnoCSS, or PandaCSS without conflicts but in this example I'm just trying to disable the utility classes without breaking the default styling based on the selected blueprint.

Utility classes disabled:

CleanShot 2023-12-29 at 15 41 45@2x

Utility classes enabled:

CleanShot 2023-12-29 at 15 41 19@2x

@kingyue737
Copy link
Contributor

I don't think we can disable utility classes without side effect #12597 (reply in thread)

@mcfarljw
Copy link
Author

mcfarljw commented Jan 5, 2024

@kingyue737 thanks for linking the discussion!

I realize it might not be easy/feasible to do but it would be nice if all components came bundled with required stylings based on the blueprint being used. As is mentioned in the linked thread TailwindCSS (or similar libraries like UnoCSS and PandaCSS) have become somewhat of a standard in terms of usage. They also come with VSCode extensions that provide a better developer experience. It seems like component libraries are embracing this like https://tailwind.primevue.org/ and which give developers the ability to mix and match without consequences.

Still love Vuetify more than other component libraries but at times it feels like utility classes are limited slightly different subset of more comprehensive existing styling solutions.

@kingyue737
Copy link
Contributor

I have the same feeling. Using CSS utility classes is the worst DX I've experienced in Vuetify. No intellisense. I need to check the document each time I want to add a class. Not util at all.

@mcfarljw
Copy link
Author

mcfarljw commented Jan 5, 2024

I think I've got most of them memorized by now with the exception of needing to check d-flex and the other flexbox classes. I know there is some VSCode extension that can be used to get basic autocomplete mentioned by someone of the core team but it's very basic.

I feel like most Vuetify specific things are prefixed with a "v" so doing the same with utility classes might actually avoid conflicts while also being more explicit:

  • text-h1 could be v-text-h1
  • rounded-xl could be v-rounded-xl
  • justify-center could be v-justify-center

@hermes85pl
Copy link

hermes85pl commented May 15, 2024

@mcfarljw, I would suggest the opposite, i.e. the names of the available utility classes should follow Tailwind, just like e.g. UnoCSS does. Perhaps they could be a reasonable subset of what one can find there. I think that it could make sense for those who might want to use them.

That said, from my perspective utility classes go against the idea of CSS and are just a short form of writing inline styles, hence they are something to potentially avoid and per my preference I would like to be able to completely disable them without any negative consequences.

As a side note, I would like to point out that the blueprints are faulty in some ways anyway and that they require some more love, e.g. in MD3 the button text should not use text-transform to shout in UPPERCASE like in MD2, and also when I disable a button while using a dark theme I would expect it to be darker (less prominent) rather than lighter (more prominent).

@fredimitchel
Copy link
Contributor

up

I'm also concerned by this issue, by disabling utilities classes, few components are not working as expected (i.e. VRow is using align-center under the hood).

As suggested @kingyue737, bunding/compiling those classes component level could avoid this issue but have an impact on potential payload overhead.

Why not supporting unocss engine as a replacement of SASS utilities ?

@planetdaz
Copy link

Why not supporting unocss engine as a replacement of SASS utilities ?

What a dream that would be!

@MatthewAry MatthewAry added T: bug Functionality that does not work as intended/expected sass labels Jan 17, 2025
@MatthewAry
Copy link
Contributor

I do believe the documentation can be improved for working with SASS. But I don't think we're going to see much improvement with this stuff without vuetify reworking itself to have unstyled components to play with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sass T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

No branches or pull requests

6 participants