Search code examples
cssruby-on-railsrubygemsstylesheetsass

How to include empty classes and IDs in sass result


I have just started using sass and still learning. I am using this command to generate css from sass:

sass --watch custom.scss:custom.css

It seems to remove empty classes and IDs. Is it possible to include them on the resulted css?


Solution

  • SASS never compiles empty classes, as a workaround you can add a CSS comment inside the class with no rules, so it will be compiled.

    .empty {
      /*I'm still empty*/
    }