SASS
Edit this pageSASS is a popular CSS preprocessor that makes authoring CSS easier. It is a superset of CSS and offers two syntaxes: SCSS and the indented syntax (often referred to as just "SASS").
Installation
Depending on your package manager, SASS can be installed as a development dependency:
Convert filename extensions
After installation, the .css
filename extensions will have to be changed to .scss
or .sass
.
The .scss
syntax is a strict superset of CSS, while .sass
offers a more relaxed syntax.
Vite, which is integrated with Solid, supports both.
However, .scss
is generally recommended.
In a Solid component:
By simply changing the file extension from .css
to .scss
or .sass
, Vite will automatically recognize these files and compile SASS to CSS on demand.
When building in production, all SASS files are converted to CSS.
This ensures compatibility with most modern browsers.