-
Notifications
You must be signed in to change notification settings - Fork 0
SASS
kitiya edited this page Apr 12, 2020
·
9 revisions
- SCSS Tutorial
- 7 Sass techniques to help you write better code
- Structuring your Sass Projects
- css-tricks: Sass Techniques from the Trenches
@mixin breakpoint($class) {
@if $class == xs {
@media (max-width: 767px) { @content; }
}
@else if $class == sm {
@media (min-width: 768px) { @content; }
}
@else if $class == md {
@media (min-width: 992px) { @content; }
}
@else if $class == lg {
@media (min-width: 1200px) { @content; }
}
@else if $class == xl {
@media (min-width: 1800px) { @content; }
}
@else {
@warn "Breakpoint mixin supports: xs, sm, md, lg, xl";
}
}aside.primary {
float: right;
width: 350px;
@include breakpoint(sm) {
float: none;
width: 100%;
}
}npm install rfs
styles.scss
@import "~rfs/scss";
body {
@include font-size(20px);
@include font-size(1.125rem);
}
h1 {
@include font-size(50px);
@include font-size(4.5rem);
}
h2 {
@include font-size(40px);
@include font-size(3.75rem);
}
h3 {
@include font-size(30px);
@include font-size(1.5rem);
}