Skip to content

Instantly share code, notes, and snippets.

@daniil4udo
Created May 19, 2020 14:36
Show Gist options
  • Save daniil4udo/62acc53bbbcfea20dd21b1c984665b38 to your computer and use it in GitHub Desktop.
Save daniil4udo/62acc53bbbcfea20dd21b1c984665b38 to your computer and use it in GitHub Desktop.
Completely responsive CSS values, more than just media queries
/*
Example
https://habr.com/ru/post/500014/
*/
/* Mobile and Tablet */
@media (max-width: 768px) {
html {
font-size: calc(16px + 2 * ((100vw - 360px) / 768));
}
}
/* Laptop and Desktops screens */
@media (min-width: 769px) and (max-width: 2048px) {
html {
font-size: calc(14px + 10 * ((100vw - 769px) / 2048));
}
}
/* Excessively large screens */
html {
font-size: 36px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment