You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sass.md 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. +++
  2. title = "Sass"
  3. weight = 110
  4. +++
  5. Sass is a popular CSS preprocessor that adds special features (e.g., variables, nested rules) to facilate the
  6. maintenance of large sets of CSS rules. If you're curious about what Sass
  7. is and why it might be useful for styling your static site, the following links
  8. may be of interest:
  9. * The [official Sass website](http://sass-lang.com/)
  10. * [Why Sass?](https://alistapart.com/article/why-sass), by Dan Cederholm
  11. ## Using Sass in Zola
  12. Zola processes any files with the `sass` or `scss` extension in the `sass`
  13. folder, and places the processed output into a `css` file with the same folder
  14. structure and base name into the `public` folder:
  15. ```bash
  16. .
  17. └── sass
  18. ├── style.scss // -> ./public/style.css
  19. ├── indented_style.sass // -> ./public/indented_style.css
  20. ├── _include.scss # This file won't get put into the `public` folder, but other files can @import it.
  21. ├── assets
  22. │ ├── fancy.scss // -> ./public/assets/fancy.css
  23. │ ├── same_name.scss // -> ./public/assets/same_name.css
  24. │ ├── same_name.sass # CONFLICT! This has the same base name as the file above, so Zola will return an error.
  25. │ └── _common_mixins.scss # This file won't get put into the `public` folder, but other files can @import it.
  26. └── secret-side-project
  27. └── style.scss // -> ./public/secret-side-project/fancy.css
  28. ```
  29. Files with a leading underscore in the name are not placed into the `public`
  30. folder, but can still be used as `@import` dependencies. For more information, see the "Partials" section of
  31. [Sass Basics](https://sass-lang.com/guide).
  32. Files with the `scss` extension use "Sassy CSS" syntax,
  33. while files with the `sass` extension use the "indented" syntax: <https://sass-lang.com/documentation/syntax>.
  34. Zola will return an error if `scss` and `sass` files with the same
  35. base name exist in the same folder to avoid confusion -- see the example above.