category: CSS
layout: 2017/sheet
tags: [Featured]
-updated: 2017-08-26
+updated: 2020-07-03
weight: -5
keywords:
- Variables
## Basics
{: .-three-column}
+### Introduction
+{: .-intro}
+
+This is a quick reference to [Sass stylesheets](https://sass-lang.com).
+
+- [Sass documentation](https://sass-lang.com/documentation) _(sass-lang.com)_
+
### Variables
```scss
```scss
.markdown-body {
- p {
+ a {
color: blue;
+ &:hover {
+ color: red;
+ }
}
+}
+```
- &:hover {
- color: red;
- }
+#### to properties
+```scss
+text: {
+ align: center; // like text-align: center
+ transform: uppercase; // like text-transform: uppercase
}
```
### Composing
```scss
-@import './other_sass_file`;
+@import './other_sass_file';
+@use './other_sass_file';
```
+The `@import` rule is discouraged because will get eventually [removed from the language](https://sass-lang.com/documentation/at-rules/import).
+Instead, we should use the [`@use` rule](https://sass-lang.com/documentation/at-rules/use).
The `.scss` or `.sass` extension is optional.
## Color functions
#### RGB
-```
+```scss
red($color) // → 0..255
green($color)
blue($color)
position: absolute;
left: 0;
}
+@else if $position == 'right' {
+ position: absolute;
+ right: 0;
+}
@else {
position: static;
}