- First of all,
npm install -g sly
- Second, make any
.sly
file - Code in Sly!
- To Compile, use the
sly --c <input .sly file>
Sly is very flexible.
You don't need curly braces, or semicolons, although you need colons. But it is based on whitespace. For example, you can do
body
color: white
background: black
It will compile to regular CSS!
You can declare variables anywhere, you just need an @
symbol to indicate it. For example @color: #FFF
, then you can use it anywhere, such as color: @color
You can nest things within each other! Here is an example
body
color: white
h1
color: red
and it will compile to:
body {
color: white;
}
body h1 {
color: red;
}
I was following a tutorial from an amazing blog post, and built on that!