which should I use (for python-based sites)? sass, compass, switchcss...alternatives? [closed]

2024/10/17 21:31:45

What is the best system to use to organize your css?

I am making several websites where I use python for back-end scripts. I'm interested in using something to help me organize LONG css scripts.

I'm curious about what python/django developers use, and have heard of switchcss. I've seen friends use sass/compass in the past, but this seems to require a ruby interpreter, and it might be good to build the sites in such a way that it would not require both python and ruby interpreters on the server (or my local machine). But if something like sass is definitively the best option, installing ruby is not difficult.

Answer

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

"There is no best system to organize CSS"

I don't have much experience with LESS though SASS made more sense to me.

You don't need Ruby on the server for SASS just install it on your computer and upload/sync the outputted css files to your server as a normal css file. (SASS can support huge websites, a normal(minified)static css file = less work on the server).

The SASS website mentions that "SASS" syntax is more concise than the newer "SCSS" syntax. Many will argue but the indents are beautiful, no brackets & no semicolons as well as import as + & mixins as = etc. The SCSS syntax was simply created to compete with the LESS syntax. I've tried both and "to me" the SASS syntax is way more fun but that's just my POV.

The text editor & its settings you use plays a huge difference when choosing between SASS & the SCSS Syntax. If you don't know how to indent 2 spaces via a shortcut you may spend the entire time screwing your face up at the SASS syntax-ed code. SCSS won't give you errors for indenting out of place, you can be as messy as you need to be (just like hand css) really down to personal choice though Chris Eppstein made sense when thinking about personal & team work convenience (in comments):

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

SCSS has populated fast, as it's default now, so if you're going to learn the SASS syntax you will probably end up knowing both since all the new resources are directed at SCSS. (BTW you can convert SASS syntax to SCSS vice versa)

So it's down to preference. Try them all including LESS. (Compass is excellent)

https://en.xdnf.cn/q/73295.html

Related Q&A

Invalid tag name error when creating element with lxml in python

I am using lxml to make an xml file and my sample program is :from lxml import etree import datetime dt=datetime.datetime(2013,11,30,4,5,6) dt=dt.strftime(%Y-%m-%d) page=etree.Element(html) doc=etree.E…

Method replacement at runtime not updating Private attributes

I understood how to replace methods at run time in Python by going through these links.[ Link1 , Link2 , & Link3].When I replaced a "update_private_variable" method of class A, its gettin…

sys.path and sys.executable is incorrect in jupyter, but no applied fix is working

Ive configured jupyter to be used from a remote computer and set a password to it while initial anaconda setup. Then after fixing this issue, I am trapped in another one. sys.path and sys.executable is…

How to multicolour text with ScrolledText widget?

from tkinter import * from tkinter.scrolledtext import ScrolledTextwindow= Tk() window.geometry(970x45) box = ScrolledText(window, width=70, height=7).pack() box.insert(END, "Ehila") #this in…

Binding Return to button is not working as expected

I bound the event <Return> to a Button, thinking that this would cause the command to be run after hitting Enter:Button(self.f, text="Print", command=self.Printer).pack(side=RIGHT, padx…

ZMQ Pub-Sub Program Failure When Losing Network Connectivity

I have a simple pub-sub setup on a mid-sized network, using ZMQ 2.1. Although some subscribers are using C# bindings, others are using Python bindings, and the issue Im having is the same for either.I…

replacing html tags with BeautifulSoup

Im currently reformatting some HTML pages with BeautifulSoup, and I ran into bit of a problem.My problem is that the original HTML has things like this:<li><p>stff</p></li>and &…

LightGBM: train() vs update() vs refit()

Im implementing LightGBM (Python) into a continuous learning pipeline. My goal is to train an initial model and update the model (e.g. every day) with newly available data. Most examples load an alread…

GTK: create a colored regular button

How do I do it? A lot of sites say I can just call .modify_bg() on the button, but that doesnt do anything. Im able to add an EventBox to the button, and add a label to that, and then change its color…

How to Normalize similarity measures from Wordnet

I am trying to calculate semantic similarity between two words. I am using Wordnet-based similarity measures i.e Resnik measure(RES), Lin measure(LIN), Jiang and Conrath measure(JNC) and Banerjee and P…