Skip to content

Instantly share code, notes, and snippets.

@YohannParis
Created May 11, 2016 19:05
Show Gist options
  • Save YohannParis/7cad6becdb9cfad47f9afe0ea5847b65 to your computer and use it in GitHub Desktop.
Save YohannParis/7cad6becdb9cfad47f9afe0ea5847b65 to your computer and use it in GitHub Desktop.
.fluid-type(@property, @min-vw, @max-vw, @min-size, @max-size) {
@{property}: @min-size;
@media screen and (min-width: @min-vw) {
@{property}: calc( @min-size ~" + " unit(@max-size - @min-size) ~" * ((100vw - " @min-vw ~") /" unit(@max-vw - @min-vw) ~")" );
}
@media screen and (min-width: @max-vw) {
@{property}: @max-size;
}
}
body {
.fluid-type(font-size, 600px, 900px, 12px, 28px);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment