quasarframework / quasar

Quasar Framework - Build high-performance VueJS user interfaces in record time
https://quasar.dev
MIT License
25.99k stars 3.53k forks source link

Remove quasar/dist/quasar.sass by a variable in quasar.conf.js. #8272

Open balabambe opened 3 years ago

balabambe commented 3 years ago

Is your feature request related to a problem? Please describe. I want a feature to remove quasar.sass in client-entry.js or server-entry.js.

Describe the solution you'd like Set a variable in quasar.conf.js to disable default quasar.sass. ex: framework.removeDefaultCss.

Describe alternatives you've considered Use other frameworks (ex: Nuxt.js). see reasons below.

Additional context I was build a page via SSR to build clean html code, but framework will load default quasar.sass in html, it's very very long long long lines in html builded code, so I try to remove it, but saw the source code (app/templates/entry/server-entry.js) did not controlled by any variables:

// We load Quasar stylesheet file
import 'quasar/dist/quasar.<%= __css.quasarSrcExt %>'

so can teams add the variable to switch off the default css for clean html? I was love the framework, and much appreciated to add the feature, thanks alot.

P.S. Sorry for my poor english. :(

balabambe commented 3 years ago

Here is my solution below:

In app/templates/entry/server-entry.js (same as app/templates/entry/client-entry.js) image

In quasar.conf.js image

Will get the great result: image

If the idea is great please let me PR to dev, thanks alot.

MarcelKlammer commented 3 years ago

Works like a charm. Thanks for that solution.

Quasar is a great tool. Adding this kind of flexibility helps alot.

PierreNansot commented 3 years ago

Is it considered by the team ?

diadal commented 3 years ago

this feature is needed

aprog commented 3 years ago

It would be good to have an option to skip styles completely or per component.

dfsworld commented 1 year ago

this feature is needed

THis feature is required

M-Shrief commented 1 year ago

This feature will help a lot when migrating to Quaser from normal use of Vuejs, also will help a lot if we can import specific styles for quasar components so that we can add scoped styles. And we'll be able to migrate easily and even add quasar components without a big problem.

So that depends on what the core team see as core feature of Quasar, is it multi-platform support only or Quasar components holds a big place in those features.

Hope the core team does it.

oboitsun commented 1 year ago

Damn how this quasar.css is annoying. For example when you use tailwind's flex it also applies quasar's flex that has this wrap rule in it. That's not good

lukaszraczylo commented 11 months ago

Okay everyone, I hit the same issue this morning but after going through quasar source code - for Quasar with Vite with SASS I managed to modify quasar.config.js

module.exports = configure(function (/* ctx */) {
  return {
  (...)
     build: {
     (...)
      alias: {
        'quasar/dist/quasar.sass': path.resolve(__dirname, './src/css/quasar.sass'),
      },
     }
  }
}

Then I created empty src/css/quasar.sass file so the build does not fail. Result: Quasar stylesheets are gone and I can enjoy using tailwind without any issues in my SSR :)

ivan006 commented 1 month ago

Bro saved my life. Was tryna scope quasar style to just apply to elements inside #q-app for my wordpress project shot my goat!