Skip to content

Instantly share code, notes, and snippets.

@fuale
Created March 7, 2019 12:46
Show Gist options
  • Save fuale/8259849a50a72b02c75c1907b31bb3e3 to your computer and use it in GitHub Desktop.
Save fuale/8259849a50a72b02c75c1907b31bb3e3 to your computer and use it in GitHub Desktop.
/**
- Create responsive font-size;
min = minimal font size
max = maximal font size
min_view = minimal view width
max_view = maximal view width
*/
responsive-font(min, max, min_view, max_view)
font-size: "calc(%spx + (%s - %s) * ((100vw - %spx) / (%s - %s)))" % (min max min min_view max_view min_view)
// example
.some_element
responsive-font(16, 22, 320, 768)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment