How To Remove SASS To Traditional CSS Setup

6.7k views Asked by At

We currently use SASS to pre-compile CSS which consists of various SCSS files.

How does one remove the implementation of SASS so that CSS files are managed directly?

As a side question, is using SASS just personal preference or is it best practice for smallish projects? Why would I want to work in several files when I can just work out of one in a syntax that I'm familiar with?

Cheers

4

There are 4 answers

1
Rajendra kumar Vankadari On

Using sass helps you organize your code in a better way. And ease the development by using nested selectors and using mixins,variables and much more which you code once and re-use many times.

One will simply go to concerned file and change the contents easily if it divided to multiple meaningful files.

And coming to your question, you can move away from sass very simply. Generate a css file once and from next time onwards start coding in your css local copy rather than extending your sass files again . :)

0
Ah Hui On

Just remove the sourceMappingURL in your main css will do.

0
Spartanicus On

You can also, should you wish, reconstruct traditional CSS by looking at what was being accomplished in the SASS files and rebuilding from scratch. This is cleaner than beginning with the compiled CSS ... but it is not for the faint-hearted: it's kind of like picking out stitches. But if the number of SASS files is few, you'll be better off.

CSS preprocessors (sass/less) were always a solution in search of a problem, in my opinion. They were likely designed by developers who were given sloppy CSS from designers who may not have had good coding practices - but in general, there is very little reason for them, and they add one more bit of unnecessary tooling. I've used them, don't like them, and will never use them again. Totally unnecessary. Good structure in one's CSS will always win.

0
Davide Cannizzo On

If you just want to move away from SASS to return to the pure CSS, you have to use the compiled stylesheet. If you compile it via command line, then you would have got the compiled CSS. Anyway, you can use an online tool to compile it, such as this.

Once a time you have the compiled CSS, you just have to import that rather than the SASS stylesheet you've been including in the HTML previously. Just insert this in your <head>.

<link rel="stylesheet" type="text/css" href="Your pure CSS stylesheet URL">