English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[ANN] CCSS 1.0
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-03-10 (19:16)
From: Dario Teixeira <darioteixeira@y...>
Subject: [ANN] CCSS 1.0

CCSS is a preprocessor for CSS (Cascading Style Sheets), extending the
language with arithmetic operations and variables.  It was born out of
frustration with the unbearable slowness and lack of support for some
CSS3 constructs in other similar tools such as LESS [1].  Here are
some points to be aware:

 - The CSS source is actually parsed into an AST, which is then converted
   again into a CSS textual representation for output.  You can therefore
   use it as a pretty-printer.  On the downside, comments are stripped out.

 - Because it is an actual parser, it is fairly straightforward to hack
   your own custom transformations to the AST.  The scanner is Ulex-based,
   whereas Menhir is required for building the parser.

 - CCSS knows only of CSS syntax, and has no knowledge of actual CSS
   properties and valid values for each.  This simplifies the program
   and makes it future-compatible, but also means that will gleefully
   accept nonsensical CSS properties such as the following:

   h1 {foo: bar;}

 - The scanner/parser does not cover some of the hairy corners of CSS.
   It does however handle new syntactic constructs introduced with CSS3.

 - The arithmetic operations are unit-aware, and will complain if you
   try adding apples and oranges, for example.

Examples of use and the syntax for the language extensions are described
in the project's homepage, which also includes building instructions and
download links [2].  Note that the source-code is released under the terms
of the GNU GPL v2.

Last, but not least, though no particular attention was given to performance,
it does fulfill the initial goal of making execution time as close to zero
as not to get in the way...

Hope you find it useful -- feedback is welcome!

Best regards,
Dario Teixeira

[1] http://lesscss.org/index.html
[2] http://ccss.forge.ocamlcore.org/