You are here

_README.txt in Drupal Commons 7.3


About SASS and Compass
----------------------

This directory includes Sass versions of AT's CSS files. All files use the SCSS
syntax.

Sass is a language that is just normal CSS plus some extra features, like
variables, nested rules, math, mixins, etc. If your stylesheets are written in
Sass, helper applications can convert them to standard CSS so that you can
include the CSS in the normal ways with your theme.

To learn more about Sass, visit: http://sass-lang.com

Compass is a helper library for Sass. It includes libraries of shared mixins, a
package manager to add additional extension libraries, and an executable that
can easily convert Sass files into CSS.

To learn more about Compass, visit: http://compass-style.org



Developing with SASS and Compass
--------------------------------

To automatically generate the CSS versions of the scss while you are doing theme
development, you'll need to tell Compass to "watch" the sass directory so that
any time a .scss file is changed it will automatically place a generated CSS
file into your sub-theme's css directory:

  compass watch <path to your sub-theme's directory>

  If you are already in the root of your sub-theme's directory, you can simply
  type:  compass watch

While using generated CSS with Firebug, the line numbers it reports will be
wrong since it will be showing the generated CSS file's line numbers and not the
line numbers of the source Sass files. To correct this problem, you can install
the FireSass plug-in into Firefox.
  https://addons.mozilla.org/en-US/firefox/addon/firesass-for-firebug/

If you do not want to use Ruby and the command line you can check out the Sassy
project for Drupal: http://drupal.org/project/sassy



Moving to Production
--------------------

Once you have finished your sub-theme development and are ready to move your CSS
files to your production server, you'll need to tell sass to update all your CSS
files and to compress them (to improve performance). Note: the Compass command
will only generate CSS for .scss files that have recently changed; in order to
force it to regenerate all the CSS files, you can use the Compass' clean command
to delete all the generated CSS files.

- Delete all CSS files by running: compass clean
- Edit the config.rb file in your theme's directory and uncomment this line by
  deleting the "#" from the beginnning:
    #environment = :production
- Regenerate all the CSS files by running: compass compile

And don't forget to turn on Drupal's CSS aggregation. :-)



File

themes/commons/commons_origins/sass/_README.txt
View source
  1. About SASS and Compass
  2. ----------------------
  3. This directory includes Sass versions of AT's CSS files. All files use the SCSS
  4. syntax.
  5. Sass is a language that is just normal CSS plus some extra features, like
  6. variables, nested rules, math, mixins, etc. If your stylesheets are written in
  7. Sass, helper applications can convert them to standard CSS so that you can
  8. include the CSS in the normal ways with your theme.
  9. To learn more about Sass, visit: http://sass-lang.com
  10. Compass is a helper library for Sass. It includes libraries of shared mixins, a
  11. package manager to add additional extension libraries, and an executable that
  12. can easily convert Sass files into CSS.
  13. To learn more about Compass, visit: http://compass-style.org
  14. Developing with SASS and Compass
  15. --------------------------------
  16. To automatically generate the CSS versions of the scss while you are doing theme
  17. development, you'll need to tell Compass to "watch" the sass directory so that
  18. any time a .scss file is changed it will automatically place a generated CSS
  19. file into your sub-theme's css directory:
  20. compass watch
  21. If you are already in the root of your sub-theme's directory, you can simply
  22. type: compass watch
  23. While using generated CSS with Firebug, the line numbers it reports will be
  24. wrong since it will be showing the generated CSS file's line numbers and not the
  25. line numbers of the source Sass files. To correct this problem, you can install
  26. the FireSass plug-in into Firefox.
  27. https://addons.mozilla.org/en-US/firefox/addon/firesass-for-firebug/
  28. If you do not want to use Ruby and the command line you can check out the Sassy
  29. project for Drupal: http://drupal.org/project/sassy
  30. Moving to Production
  31. --------------------
  32. Once you have finished your sub-theme development and are ready to move your CSS
  33. files to your production server, you'll need to tell sass to update all your CSS
  34. files and to compress them (to improve performance). Note: the Compass command
  35. will only generate CSS for .scss files that have recently changed; in order to
  36. force it to regenerate all the CSS files, you can use the Compass' clean command
  37. to delete all the generated CSS files.
  38. - Delete all CSS files by running: compass clean
  39. - Edit the config.rb file in your theme's directory and uncomment this line by
  40. deleting the "#" from the beginnning:
  41. #environment = :production
  42. - Regenerate all the CSS files by running: compass compile
  43. And don't forget to turn on Drupal's CSS aggregation. :-)