No, there's no way to dynamically access variables like that. Here's
what I'd suggest:
=pct(!n, !color)
.pct#{!n}
background-color = !color
+pct(0, #fff)
+pct(f0faff)
If you're using the Sass 3 beta, though, it might be worthwhile to
just use the lighten() function:
$pctblue: #0DB0FF
@for $n from 0 to 9
.pct#{$n}
background-color: lighten($pctblue, $n * 50%/9)
On Mon, Apr 19, 2010 at 12:11 PM, jdwy <[email protected]> wrote:
> Here's what I was hoping to do. 10 color variables, then loop and look
> them up with little reflection. Is there any way to get this to work?
> Or a better tack to take? Thanks.
>
> !pctblue0 = #FFF
> !pctblue1 = #F0FAFF
> ...
>
> @for !n from 0 to 9
> .pct#{!n}
> background-color = !pctblue#{!n}
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Haml" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/haml?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Haml" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/haml?hl=en.