Changing SASS options


#1

I want to change the amount of decimal points after the period in scss using the --precision option. Any idea on where I should ideally do that?


#2

Here should work:


#3

Hey @knowler, thank you very much! Do I have to include that in the webpack.config.optimize.js and webpack.config.watch.js files as well, if I want that option everywhere? Or is the config enough as long as its not overwritten somewhere else?


#4

Just webpack.config.js since it is the base config. The watch config only runs during live development and optimize on a production build. They just add a few tasks.

You can run some tests to see if there is a difference between build and build:production, however, I do know from experience that cssnano will preserve the decimal length.


#5

Ah, thanks for claryfing that. It works.

I have created (and am creating) a system in sass for typography and vertical rhythm that utilizes musical composition, and need many decimal numbers as musical intervals can get quite messy and I have to convert a lot from px to rem. Thanks a lot for helping!


#6

That’s so cool. I’ve been trying something similar with Tailwind. Since its config is all JS, I can set the type + spacing scales with a function. I would like to do something similar with color.