Hello wrold soper description
$variable-name: some-value
.some-class {
@extend .class-name
}
@mixin some-name($param-name) {
...
@content;
...
}
@mixin some-name($param-name: some-default-value) {
...
@content;
...
}
Usage:
@include some-name(50px);
length($list-name);
// if you select a negative nuber
// you start from the end of the array
// ex. nth($list-name, -1); // is the last element
nth($list-name, $one-base-index);
index($list-name, $value-to-search);
color: saturate($color: #9923FF, $amount: 50%);
color: lighten($color: #9923FF, $amount: 10%);
color: darken($color: #9923FF, $amount: 20%);
color: adjust-hue($color: #9923FF, $degrees: 70deg);
@media print {
@at-root (with: media) {
.bar {
color: red;
}
}
}
// will produce
@media print {
.bar {
color: red;
}
}
@media print {
@at-root (without: media) {
.bar {
color: red;
}
}
}
// will produce
.bar {
color: red;
}
@if a==b
// ...
@else if a==c
// ...
@elseif a==d
// ...
@else
// ...
if(a == b, "they are equal", "they are NOT equal");
@if not $bool {
// We get in there
}
$value1: 42em;
$value2: 42;
$unitless: unitless($value1); // false
$unitless: unitless($value2); // true
$unicorn: 'rainbow';
$variable-exists: variable-exists('unicorn'); // true
@media (min-width: 42em) {
.foo {
color: red;
@media (max-width: 50em) {
color: blue;
}
}
}
// will produce
@media (min-width: 42em) {
.foo {
color: red;
}
}
@media (min-width: 42em) and (max-width: 50em) {
.foo {
color: blue;
}
}
Use
@extend .bar !optional
if the parent class (.bar) might not be defined.
// I know who to do it (like in C#)
@function my-function($specific-argument, $extra-arguments...) { ... }
You can check an object's type by doing type-of($object-dentifier)
.