Which should I use (for python based sites)? sass, compass, switchcss ... alternatives?

Which system is best for organizing your css?

I create several sites on which I use python to create source scripts. I am interested in using something to help me organize LONG css scripts.

I'm curious what the python / django developers are using and have heard of switchcss. I saw friends using sass / compass in the past, but it seems to need a ruby ​​interpreter, and it would be nice to create sites in such a way that both python and ruby ​​interpreters (or my local machine are not required) ) But if something like sass is ultimately the best option, installing ruby ​​is straightforward.

+6
source share
3 answers

I asked myself the same question a few days ago. After extensive research:

"There is no better system for organizing CSS"

I have little experience with LESS, although SASS makes more sense to me.

You do not need Ruby on the server , since SASS simply installs it on your computer and downloads / synchronizes the output css files to your server as a regular css file. (SASS can support huge sites, the usual (reduced) static css file = less work on the server).

The SASS website mentions that the "SASS" syntax is shorter than the new SCSS syntax . Many will argue, but the indentation is beautiful, there are no brackets and semicolons, as well as import as + and mixins as =, etc. The SCSS syntax was simply created to compete with the LESS syntax. I tried both and for me the SASS syntax is much more fun, but this is just my POV.

The text editor and its settings that you use play a huge role when choosing between SASS and SCSS syntax . If you don’t know how to highlight 2 spaces using a shortcut, you can spend all the time twisting your face up in the SASS syntax code. SCSS will not give you errors for indenting from the place, you can be as dirty as you need (just like css css), up to a personal choice, although Chris Epstein made sense when he thought about personal and team work (in the comments):

http://thesassway.com/articles/sass-vs-scss-which-syntax-is-better

SCSS is populated quickly, as by default, so if you are going to learn the SASS syntax, you will probably find out in the end, as all new resources are directed to SCSS. (BTW you can convert SASS syntax to SCSS vice versa)

So, this is preference. Try them all, including LESS. (Compass is excellent)

+9
source

Have you looked at LESS? I tried the Sass / Scss route itself, but the Python ports of the original Ruby did not seem to match their predecessor.

LESS is javascript, its client version does not rely on Node.js (as Stylus does) and has extremely intuitive syntax (although I'm not sure why arroba was chosen to declare a variable).

On the client side (there is also a server option), you simply include a link to the code in your head using the standard script element:

<script src="js/less.js" type="text/javascript"></script> 

and then instead of rel="stylesheet/css you use rel="stylesheet/less" to reference an external stylesheet.

0
source

Try CSS-On-Diet . It is written in Python, and you can install it from PYPI:

 pip install CSSOnDiet 
0
source

Source: https://habr.com/ru/post/912095/


All Articles