how to

matslats - November 13, 2009 - 04:57
Project:Css Dry
Version:6.x-1.0-beta1
Component:Documentation
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

I don't see any indication of how to use this module.
It doesn't implement a single Drupal hook.
Is it a command line tool?
Am I missing something obvious? Hope so.

#1

rhache - November 13, 2009 - 19:06

As of the October 21 Beta 1 and October 22 dev release, here's what you need to do:

  1. Add the following code in your theme's template.php file:
    if (module_exists('cssdry')) {
       drupal_add_css(cssdry_stylesheet(drupal_get_path('theme', 'a_theme') .'my_css.css'), 'theme');
    }

    and replace "my_css.css" with the proper css path/filename. If you have multiple stylesheets, you can add the rest with the CSS @import declaration in your main CSS file.
  2. Start coding your stylesheets with the CSS Dry syntax as outlined in the readme.markdown file.
  3. When you make changes to your CSS, clear you theme registry cache. The module maintainers are working on a way to have an "always generate" mode to facilitate this during development (#611774: Updating an imported file doesn't invalidate the generated file).

Keep in mind that this is really early stage documentation given the active development of this module. The module maintainers are also working on a way to add the stylesheets via the info file (#611640: Any plans to add files from info files?) so this maybe out of date very soon.

Rene

#2

Hugo Wetterberg - November 16, 2009 - 15:43

Thanks for the help in the issue queue Rene. I've added a duplicate link to the gist with the full example so that people won't miss it as easily.

Cheers
/Hugo

#3

rhache - November 17, 2009 - 16:40

Small Revision to initial documentation

  1. Add the following code in your theme's template.php file:
    if (module_exists('cssdry')) {<br/>   drupal_add_css(cssdry_stylesheet(drupal_get_path('theme', 'your_theme') .'my_css.css'), 'theme');<br/>}
    and replace "my_css.css" and "your_theme" with the proper css path/filename and theme name, respectively. If you have multiple stylesheets, you can add the rest with the CSS @import declaration in your main CSS file.
  2. Start coding your stylesheets with the CSS Dry syntax as outlined in the readme.markdown file.
  3. When you make changes to your CSS, clear you theme registry cache. The module maintainers are working on a way to have an "always generate" mode to facilitate this during development (#611774: Updating an imported file doesn't invalidate the generated file).

Keep in mind that this is really early stage documentation given the active development of this module. The module maintainers are also working on a way to add the stylesheets via the info file (#611640: Any plans to add files from info files?) so this maybe out of date very soon.

Rene

#4

allain - November 17, 2009 - 21:39

Stylesheets may now be added from info files just like the current stylesheets are.

For example, as of beta2, the following will work:

cssdry[all][] = style.css

#5

Hugo Wetterberg - November 17, 2009 - 21:39
Status:active» fixed

#6

rhache - November 21, 2009 - 21:55

New instructions for the Beta 2 release.

  1. Enable the module
  2. You can add stylesheets in the following two ways:
    1. Add stylesheets in your theme's info file
      cssdry[all][] = defaults.css
    2. Add the following code in your theme's template.php file:
      if (module_exists('cssdry')) {
         drupal_add_css(cssdry_stylesheet(drupal_get_path('theme', 'a_theme') .'my_css.css'), 'theme');
      }

      and replace "my_css.css" with the proper css path/filename. If you have multiple stylesheets, you can add the rest with the CSS @import declaration in your main CSS file.

    We highly recommend using the info file method as much as possible, especially since it supports nested themes (ie base theme with one or more sub-themes).

  3. Start coding your stylesheets with the CSS Dry syntax as outlined in the readme.markdown file.

Enjoy!

#7

System Message - December 5, 2009 - 22:00
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.