cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pier Fumagalli <p...@betaversion.org>
Subject Re: [CONTRIB] css engine
Date Mon, 05 Jul 2004 14:13:01 GMT
I was thinking more-or-less at something similar... Good to see that 
someone is actually implementing it...

One nifty comment, is how to handle the "cascading" part of "style 
sheets": wouldn't it be better to rewrite your example below into 
something like this:

<css>
   <define name="color-bg" value="#FF2345"/>
   <define name="medium-r" value="2"/>
   <define name="width-rp" value="{100 - (2 * $medium-r)}" agent="! 
ie6"/>
   <define name="width-rp" value="100" agent="ie6"/>
   <define name="box" left="4pt" right="4pt" top="1pt" bottom="1pt/>

   <rule select="#body-container">
     <marging value="{@box}"/>
     <padding value="{$medium-r}%"/>
     <width value="{$width-rp}%"/>
     <float value="left"/>

     <rule select="li">
       <margin value="0"/>
       <float value="left "agent="ie5mac"/>

       <rule select="a">
         <padding value="{@box}"/>
         <background color="{$color-bg}"/>
       </rule>
     </rule>

     <rule select="#body-container p" agent="ie6">
       <!-- thif f%*#ing browser drive me crazy -->
     </rule>
   </rule>
</css>

Nesting the children of the cascade into elements themselves?

	Pier

On 3 Jul 2004, at 14:43, BURGHARD √Čric wrote:

> Hi again,
>
> I just finished a css engine which we use in our project which can 
> help you
> to virtualize all your css in a pipeline, and handle browser 
> specificities
> in a clean way (no more css syntax hacking). Perhaps it could be 
> valuable
> for others.
>
> Here is the description:
> - it's xml syntax
> - it has a preprocesseur engine (variables -- string, number, xpath
> expressions -- and include)
> - it's browser aware (it's his main purpose)
> - it's entirely based on xslt (fast enough anyway ;-)
>
> Example:
>
> <css>
>   <!-- defines or rules can be put in a separate file and included with
> include src="some_macros_css.xml" anywhere -->
>   <define name="color-bg" value="#FF2345"/>
>   <define name="medium-r" value="2"/>
>   <define name="width-rp" value="{100 - (2 * $medium-r)}" agent="! 
> ie6"/>
>   <!-- width on a floated box with relative padding is alway 100 for 
> ie6 ??
> -->
>   <define name="width-rp" value="100" agent="ie6"/>
>   <define name="box" left="4pt" right="4pt" top="1pt" bottom="1pt/>
>
>   <rule select="#body-container">
>     <marging value="{@box}"/>
>     <padding value="{$medium-r}%"/>
>     <width value="{$width-rp}%"/>
>     <float value="left"/>
>   </rule>
>
>   <rule select="#body-container li"/>
>     <margin value="0"/>
>     <!-- float only on ie5mac ? -->
>     <float value="left "agent="ie5mac"/>
>   </rule>
>
>   <rule select="#body-container li a>
>     <padding value="{@box}"/>
>     <background color="{$color-bg}"/>
>   </rule>
>
>   <rule select="#body-container p" agent="ie6">
>     <!-- thif f%*#ing browser drive me crazy -->
>   </rule>
> </css>
>
> I guess i had to use nagoya (mispelled ?) to submit the 
> stylesheets+install
> proc, but tell me first if it's cocoon or lenya/forrest relevant ?
>
> Regards
>
>

Mime
View raw message