[Interest] pre-processing for Qt widget stylesheet

Alejandro Exojo suy at badopi.org
Wed Aug 12 09:01:53 CEST 2015


El Wednesday 12 August 2015, André Somers escribió:
> I guess any template engine would do, really. Perhaps take a look at
> grantlee?

The problem is that Sass is more than a template engine. Is a language crafted 
for generating CSS. It has functions for colors, understands selector 
inheritance, and a lot more. See for example:

http://sassymothereffingtextshadow.com/

OK, probably not the best example, since very rarely you make use of loops in 
Sass code. The next is something not easily achievable with a normal template 
language, and is one of the most interesting use cases:

http://sass-lang.com/guide#topic-3

The only solution I can think of, unless libsass has hooks for extension 
points for your problems, is pre and post process the Sass/CSS code. Try to 
see if there is some way that you can "tag" the elements with the invalid 
pseudo-classes (a diferent pseudo-class or an ad-hoc class that you use for 
that), and use some regular expression to do replacements.

-- 
Alex (a.k.a. suy) | GPG ID 0x0B8B0BC2
http://barnacity.net/ | http://disperso.net



More information about the Interest mailing list