RCSS is designed to solve the problem of maintaining CSS by offering new syntax and pre-processing capabilities. It helps simplify CSS structure and makes it more manageable.
The first method is through using ERB templates. ERB templating is a flexible solution that uses standard ERB syntax found in rhtml files. With this method, users have access to values defined in the controller and can thus access the database through ActiveRecord, allowing for database-driven CSS themes. While this method has strengths in its access to application data and flexible Ruby syntax, it may have weaknesses such as unfamiliar syntax to CSS designers and error-prone embedding, making it less portable.
A code example for using ERB templates is included, showcasing the use of templates for color and background values in the body and h1 elements.
The second method Rcss offers is Server-side Constants. Originally developed by Shaun Inman in PHP, Server-side Constants extend CSS syntax in a simple way. While Rcss differs from the original implementation in that constants may have complex values and includes are not implemented, this method remains simple and cross-platform, making it easy to use. However, it only offers simple constant substitution.
An example code block is included that showcases the use of server-side constants for color, font, and background values in the body and h1 elements.
Finally, this release of Rcss includes the use of Ruby 1.8.2 for builds, fixing an invalid GEM problem and making installation possible. Overall, Rcss offers useful solutions for dealing with the difficult issue of CSS maintainability.
Version 0.3.1: N/A