V
V
vince_masuka2015-06-15 22:31:38
css
vince_masuka, 2015-06-15 22:31:38

How do you maintain CSS code?

Hello.
In the project where I participate, we use the grunt-task manager and the grunt-contrib-sass plugin for sass -> css compilation, the essence of the problem is that the compilation time itself has reached 35 seconds, waiting for such an amount of time after each change is terrible.
There are two options here:

  • replace sass with-compass with libsass and sassc (C implementation)
  • clean up styles from unused ones with the help of Dust-Me Selectors, uncss

Today I worked on the first option, but in the end I couldn’t make it work, I’m afraid that some things are incompatible or work differently and as a result they will have to be rewritten to work under sassc.
As for the second option, I don’t even know where to start, manually going through the styles is a long torment, and using tools is also not quite an option, there are some troubles.
I'm wondering how others are doing with this, do you clean up unused css code on a daily basis or do you do it when signs appear? Do you use special tools or do you find it manually?
Update
As a result, we switched to libsass, the compilation time was reduced to 3 seconds.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
N
Nikolay Talanov, 2015-06-15
@vince_masuka

35 seconds is some kind of akhtung.
About the fact that Gulp is much faster than the current Grunt, this is true. For Grunt works on the basis of temporary files (they want to change this soon), and Gulp stores everything in the RAM, sort of.
+ As I understand it, you have Ruby SASS, and it is very slow compared to libsass ( sassbreak.com/ruby-sass-libsass-differences here they write about the huge difference in compilation speed).
About a year ago I made a project on grunt + sass (ruby version), and after changing the styles I had to wait ~ 3-5 seconds until the live load with new styles.
Now I use gulp + libsass, after pressing ctrl + s I instantly expand the browser, and there is already a page with new styles. I even tried to make a save in time and see at least a “flash” from inserting new styles, but it didn’t work out :)

D
Denis Ineshin, 2015-06-15
@IonDen

Are you sure that this sass in css takes so long to compile? Maybe there are some other tasks that work? Let's say code compression or JS tasks in general. Try to single out a separate task in the ground.
If all else fails, try Gulp. They say it works much faster.

Z
zooks, 2015-06-16
@zooks

It's faster to switch to libsass, which is incredibly fast with C/C++, than to clean up unused code.

N
Nikolai Shabalin, 2015-06-16
@nikolayshabalin

Six months since I switched from Sass + Compass to Libsass.
And with recent updates, I advise you to run behind the computer and switch to Libsass.
Look at this sign =) 98.53%
And in the next two or three weeks there will be an update to 3.3. There will be no proofs, as long as there are rumors.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question