![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | |
|
Programmer
Join Date: Jun 2007
Posts: 93
Rep Power: 2
![]() |
HAML - Markup Haiku
While lurking around the bakery i stumbled across a pretty neat html templating language, HAML.
What exactly is HAML? taken straight from the front page of the haml website Quote:
haml also has a css counterpart called sass, which is what i'm really here to talk about. Sass looks like css, for the most part but adds LOTS of new functionality. Ever wish you could declare a constant in css? you can with sass. Sass is incredible, i wish real css worked like sass. there is a haml implementation for php but no sass. I don't plan on using haml in any of my projects because it seems cumbersome, why develop a page in haml when xhtml is second nature.. The only use i have for haml is being able to fit more code on a hand written page, i have a small legend that i can refer to when parsing haml into xhtml. Anyway check out the site it's a pretty neat project. I'm considering of porting sass to python so i can just batch render a bunch of sass files to css Last edited by MiKuS; May 14th, 2008 at 6:49 AM. Reason: added baker link |
|
|
|
|
|
|
#2 |
|
Hobbyist Programmer
|
Re: HAML - Markup Haiku
And why, exactly, would you want to declare constants in your style sheet? To save a little bit on copy and pasting? I sure hope it isn't trying to mix logic with the style sheet
__________________
#programmingforums relay - http://thegupstudio.com/cgi-bin/pforelay.cgi freelance scripts - http://ryanguthrie.com/index.html |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Jun 2007
Posts: 93
Rep Power: 2
![]() |
Re: HAML - Markup Haiku
to an extent, it would be nice to mix logic into my stylesheet albeit not a lot.
!main_color = #00ff00
#main
:color = !main_color
:p
:background-color = !main_color
:color #000000is compiled to
#main {
color: #00ff00; }
#main p {
background-color: #00ff00;
color: #000000; }with sass it is also possible to do basic arithmatic: !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 #main {
background-color: #a5f39e; }
#main p {
background-color: #c5ffbe;
width: 10em; }
#main img.thumb {
width: 25em; }as far as logic goes the above is about as complex as you can go, you can perform arithmetic on colours but thats about it. Yes i don't like copy and pasting the same thing over and over again (DRY), I tend to use only a handful of colours and I would rather be able to say !highlight for a highlight or !base for my base colour, opposed to looking through my notes for the colour, copying it, flicking back to my editor, and pasting it. even scrolling to the last occurrence of the colour i want can be a hassle.. why not avoid it? |
|
|
|
|
|
#4 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,799
Rep Power: 5
![]() |
Re: HAML - Markup Haiku
I've actually wanted to use math in my CSS many times, to make things like width adjustments proportional. That's neat. Thanks.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| help out beginner with some errors (solved) | monka | Java | 8 | Mar 3rd, 2005 8:50 PM |