Last active
December 25, 2020 13:52
-
-
Save igortatarenko/aba6724b7a2d7570a32c7003569ef364 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ============================================================================= | |
| // Медиа запросы | |
| // ============================================================================= | |
| // меньше указанной величины (по умолчанию ширина) | |
| @mixin below($width, $orientation: 'width') { | |
| @media screen and (max-#{$orientation}: $width) { | |
| @content; | |
| } | |
| } | |
| // больше указанной величины (по умолчанию ширина) | |
| @mixin above($width, $orientation: 'width') { | |
| @media screen and (min-#{$orientation}: $width) { | |
| @content; | |
| } | |
| } | |
| // между первой и второй величиной (по умолчанию ширина) | |
| @mixin between($minWidth, $maxWidth, $orientation: 'width') { | |
| @media screen and (min-#{$orientation}: $minWidth) and (max-#{$orientation}: $maxWidth) { | |
| @content; | |
| } | |
| } | |
| // ============================================================================= | |
| // Функции пересчета значений | |
| // ============================================================================= | |
| @function rem($num) { | |
| $strip-unit: $num / ($num * 0 + 1); | |
| @return $strip-unit / 16 * 1rem; | |
| } | |
| @function em($num, $root: 16) { | |
| $strip-unit: $num / ($num * 0 + 1); | |
| @return $strip-unit / $root * 1em; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment