vuetify icon indicating copy to clipboard operation
vuetify copied to clipboard

[Feature Request] Replace Stylus with SASS

Open mitar opened this issue 9 years ago • 38 comments

New Functionality

I have been a long lover of Stylus and I was really glad to see that Vuetify is using it. But after some time I realized that Stylus development has stagnated and this really means it is easy to hit issues, especially as CSS continues to be developed.

I would propose that Stylus is replaced with SASS.

Improvements

This would make it future proof and as Vuetify is closing to 1.0 is probably the last moment to do so. Especially as we will be developing themes and so on.

Bugs or Edge Cases it Helps Avoid

There are many bugs reported but not addressed to Stylus, which all software which depends on it can then have. This is especially a problem if one does not want to use a compiled dist version of Vuetify CSS, but import directly Stylus code.

mitar avatar Oct 30 '17 08:10 mitar

(╯°□°)╯︵ ┻━┻

johnleider avatar Nov 01 '17 00:11 johnleider

Duplicate of #1857, but worded a bit better.

Also https://github.com/vuetifyjs/vuetify/issues/543#issuecomment-301524079

KaelWD avatar Nov 01 '17 05:11 KaelWD

I just installed sass-loader and node-sass locally, and I can use either stylus or sass in my .vue files. You can choose to ignore working with stylus and use only sass. FYI, this is true testing from this HNPWA template with Vuetify added.

bonatoc avatar Nov 01 '17 12:11 bonatoc

But to configure a theme, or access other Vuetify variables, you have to use Stylus,.

mitar avatar Nov 01 '17 17:11 mitar

Only for about another week :)

johnleider avatar Nov 01 '17 17:11 johnleider

Oh. :-) I hope I will be able to access variables (like padding amounts, etc.) in a week as well. This is very useful to define additional CSS rules matching the same sizes.

mitar avatar Nov 01 '17 17:11 mitar

Absolutely, none of that changes, just easier to specify theme specific colors.

johnleider avatar Nov 01 '17 17:11 johnleider

OK, but one cannot access variables from SCSS, no? Maybe could variables be exported as CSS variables?

mitar avatar Nov 01 '17 17:11 mitar

And I still worry that core Stylus styles might break. :-(

mitar avatar Nov 01 '17 17:11 mitar

I have no idea where you get that notion from, if you want we can continue this conversation on https://chat.vuetifyjs.com

johnleider avatar Nov 01 '17 17:11 johnleider

Duplicate of #1857

johnleider avatar Nov 06 '17 01:11 johnleider

... and #586

I bet this will keep popping up. Would it make sense to arrange a fundraiser for SASS support?

By the way, it seems it is possible to convert SASS to Stylus: https://github.com/mojotech/sass2stylus/, so perhaps there is a way to keep both camps happy.

mrts avatar Nov 27 '17 20:11 mrts

Never really thought of that.

johnleider avatar Nov 27 '17 20:11 johnleider

And here is some evidence that this will keep popping up more and more as Vuetify gains popularity: http://stateofjs.com/2017/css/results

18 K people have used and will use SASS/SCSS, only 9% (1.7 K / 18 K) say that they will not use it again, whereas 2,4 K people have used and will use Stylus, but 80% (1.9 K / 2.4 K) will not use it again.

Maybe the SASS/SCSS-to-Stylus-and-back-again toolchain would really be a way forward? So that people could freely choose during project generation:

Use SASS, SCSS or Stylus? SASS

mrts avatar Dec 13 '17 08:12 mrts

I investigated Stylus code a bit and it looks neat and easily extensible. I propose to implement compilation to SASS or SCSS right inside Stylus itself. The Stylus folks look generous and open-minded, so I'm pretty sure they are willing to accept the pull request. The main developer openly acknowledges in https://github.com/stylus/stylus/issues/2282#issuecomment-295374929 that he has no energy to maintain Stylus (kudos to him for being open about that!), so he may feel relieved there is an alternative way forward for the community.

stylus.js is the compiler library entry point. As far as I can see, the only thing required is to implement a custom Compiler and this doesn't look too scary given that the CSS compiler is only 500 lines. I'm probably overly optimistic though :).

@johnleider would you endorse this and add official SASS support to the project generator if someone else takes care of the Stylus-to-SASS/SCSS part in Stylus?

mrts avatar Dec 17 '17 11:12 mrts

Yes

johnleider avatar Dec 18 '17 12:12 johnleider

Perfect, thank you!

mrts avatar Dec 18 '17 20:12 mrts

This would be awesome! Where to start?

maziarz avatar Jan 02 '18 13:01 maziarz

@johnleider Would you agree a PR if we partially change from stylus to SCSS/SASS (step-by-step)? Or do you want one huge PR to change everything at once?

Should we use SASS or SCSS?

pschaub avatar Jan 02 '18 13:01 pschaub

Without starting a war, i would vouch for SCSS..

maziarz avatar Jan 02 '18 13:01 maziarz