cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BURGHARD √Čric <eric.burgh...@systheo.com>
Subject [CONTRIB] css engine
Date Sat, 03 Jul 2004 13:43:07 GMT
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