Last active
November 3, 2020 22:46
-
-
Save Andrii-Yukhymenko/76bbb3e0a6eb6f51c4806913064eef64 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
// Пример записи: | |
// $maxWidth: Ширина КОНТЕЙНЕРА, без px!; | |
// Пример подключения: | |
// @include adaptiv-font(Размер текста в макете, размер текста при 320px); | |
$maxWidth: 1200; | |
@mixin adaptiv-font($pcSize, $mobSize) { | |
font-size: #{$pcSize + px}; | |
@media (max-width: #{$maxWidth + px}){ | |
$addSize: $pcSize - $mobSize; | |
$maxWidth: $maxWidth - 320; | |
font-size: calc(#{$mobSize + px} + #{$addSize} * ((100vw - 320px) / #{$maxWidth})); | |
} | |
} |
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
$maxWidth: 1920; | |
@mixin adaptiv-font($pcSize, $mobSize) { | |
$addSize: $pcSize - $mobSize; | |
$maxWidth: $maxWidth - 320; | |
font-size: calc(#{$mobSize + px} + #{$addSize} * ((100vw - 320px) / #{$maxWidth})); | |
} | |
// Пример записи | |
// $maxWidth: Ширина макета, без px!; | |
// @include adaptiv-font(Размер текста в макете, размер текста при 320px); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment