News for hackers. Stuff that matters.
Re:Making CSS saner (from Patrick of Auctomatic) by earthboundkid on Tuesday May 29, 2007 @03:45PM (#25271)
This has already been done by SASS (http://haml.hamptoncatlin.com/docs/sass).

Ex. In SASS

!main_width = 10

!unit1 = em

!unit2 = px

!bg_color = #a5f39e #main

:background-color = !bg_color

p

:background-color = !bg_color + #202020

:width = !main_width + !unit1

img.thumb

:width = (!main_width + 15) + !unit2

yields

#main {

background-color: #a5f39e; }

#main p {

background-color: #c5ffbe;

width: 10em; }

#main img.thumb { width: 25em; }

(Edit: Is there some way to format comments here on new.yc like there is on Reddit? I tried using both pre tags and indenting and neither worked…)

Re:Making CSS saner (from Patrick of Auctomatic) by pc on Tuesday May 29, 2007 @05:53PM (#25284)
This requires you migrate your stylesheets to a totally new syntax, which isn't a great solution.