[Zope-dev] Re: ZPT for CSS, anyone?

Shane Hathaway shane at zope.com
Thu Apr 1 16:47:57 EST 2004


Chris Withers wrote:
> Shane Hathaway wrote:
> 
>> BTW instead of TAL, it should be called SAL, Style Attribute Language. 
>> TAL needs a sister. :-)
> 
> 
> Arg! No more languages! :'(

I think it would be pretty neat. :-)

> Still, maybe a TALES-in-plain-text thing has some merits, but then you 
> want defines, a repeats, and you end up with TAL.

Repeats wouldn't make sense in this language.  Conditions would, but 
they would apply to the whole rule, not individual attributes.

> template="""
> p {
>   color: %(color)s;
>   background-color: %(bgcolor)s;
> }
> """
> preferences = context.getProperty('preferences',{})
> dict = {
>  'color':preferences.get('color','gray'),
>  'bgcolor':preferences.get('bgcolor'white'),
> }
> return template % dict

That's a mess.

Shane



More information about the Zope-Dev mailing list