Created
July 25, 2016 21:55
-
-
Save davidpanzarella/2c87bde751faa378c1abbbb52f09f9be to your computer and use it in GitHub Desktop.
Revisions
-
indrekpaas revised this gist
Apr 2, 2016 . 2 changed files with 16 additions and 35 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,22 +2,22 @@ // libsass (v3.3.2) // ---- // ========================================================================= // // PRECISE CONTROL OVER RESPONSIVE TYPOGRAPHY FOR SASS // --------------------------------------------------- // Indrek Paas @indrekpaas // // Inspired by Mike Riethmuller's Precise control over responsive typography // http://madebymike.com.au/writing/precise-control-responsive-typography/ // // `strip-unit()` function by Hugo Giraudel // // 31.03.2016 Remove redundant parenthesis from output // 02.10.2015 Add support for multiple properties // 24.04.2015 Initial release // // ========================================================================= @mixin fluid-type($properties, $min-vw, $max-vw, $min-value, $max-value) { & { @@ -39,14 +39,10 @@ } } @function strip-unit($value) { @return $value / ($value * 0 + 1); } /* Single property */ html { @include fluid-type(font-size, 320px, 1366px, 14px, 18px); 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 charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,3 @@ /* Single property */ html { font-size: 14px; -
indrekpaas revised this gist
Mar 31, 2016 . 2 changed files with 7 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ // ---- // libsass (v3.3.2) // ---- /*! ======================================================================== @@ -13,6 +13,7 @@ `strip-unit()` function by Hugo Giraudel 31.03.2016 Remove redundant parenthesis from output 02.10.2015 Add support for multiple properties ======================================================================== */ @@ -26,7 +27,7 @@ @media screen and (min-width: $min-vw) { @each $property in $properties { #{$property}: calc(#{$min-value} + #{strip-unit($max-value - $min-value)} * (100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)}); } } 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 charactersOriginal file line number Diff line number Diff line change @@ -9,6 +9,7 @@ `strip-unit()` function by Hugo Giraudel 31.03.2016 Remove redundant parenthesis from output 02.10.2015 Add support for multiple properties ======================================================================== */ @@ -19,7 +20,7 @@ html { @media screen and (min-width: 320px) { html { font-size: calc(14px + 4 * (100vw - 320px) / 1046); } } @@ -37,8 +38,8 @@ h1 { @media screen and (min-width: 20em) { h1 { padding-bottom: calc(2em + 2 * (100vw - 20em) / 50); padding-top: calc(2em + 2 * (100vw - 20em) / 50); } } -
indrekpaas revised this gist
Oct 31, 2015 . No changes.There are no files selected for viewing
-
indrekpaas revised this gist
Oct 30, 2015 . 2 changed files with 9 additions and 48 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -53,11 +53,5 @@ html { /* Multiple properties with same values */ h1 { @include fluid-type(padding-bottom padding-top, 20em, 70em, 2em, 4em); } 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 charactersOriginal file line number Diff line number Diff line change @@ -31,53 +31,20 @@ html { /* Multiple properties with same values */ h1 { padding-bottom: 2em; padding-top: 2em; } @media screen and (min-width: 20em) { h1 { padding-bottom: calc(2em + 2 * ((100vw - 20em) / 50)); padding-top: calc(2em + 2 * ((100vw - 20em) / 50)); } } @media screen and (min-width: 70em) { h1 { padding-bottom: 4em; padding-top: 4em; } } -
indrekpaas revised this gist
Oct 3, 2015 . 2 changed files with 6 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -6,12 +6,14 @@ PRECISE CONTROL OVER RESPONSIVE TYPOGRAPHY FOR SASS --------------------------------------------------- Indrek Paas @indrekpaas Inspired by Mike Riethmuller's Precise control over responsive typography http://madebymike.com.au/writing/precise-control-responsive-typography/ `strip-unit()` function by Hugo Giraudel 02.10.2015 Add support for multiple properties ======================================================================== */ 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 charactersOriginal file line number Diff line number Diff line change @@ -2,12 +2,14 @@ PRECISE CONTROL OVER RESPONSIVE TYPOGRAPHY FOR SASS --------------------------------------------------- Indrek Paas @indrekpaas Inspired by Mike Riethmuller's Precise control over responsive typography http://madebymike.com.au/writing/precise-control-responsive-typography/ `strip-unit()` function by Hugo Giraudel 02.10.2015 Add support for multiple properties ======================================================================== */ /* Single property */ -
indrekpaas revised this gist
Oct 1, 2015 . 1 changed file with 58 additions and 30 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -12,42 +12,70 @@ ======================================================================== */ /* Single property */ html { font-size: 14px; } @media screen and (min-width: 320px) { html { font-size: calc(14px + 4 * ((100vw - 320px) / 1046)); } } @media screen and (min-width: 1366px) { html { font-size: 18px; } } /* Multiple properties with same values */ h1 { font-size: 14px; margin-bottom: 14px; } @media screen and (min-width: 320px) { h1 { font-size: calc(14px + 4 * ((100vw - 320px) / 1046)); margin-bottom: calc(14px + 4 * ((100vw - 320px) / 1046)); } } @media screen and (min-width: 1366px) { h1 { font-size: 18px; margin-bottom: 18px; } } /* Multiple properties with different values */ div { padding: 14px; } @media screen and (min-width: 320px) { div { padding: calc(14px + 4 * ((100vw - 320px) / 1046)); } } @media screen and (min-width: 1366px) { div { padding: 18px; } } div { width: 8em; } @media screen and (min-width: 20em) { div { width: calc(8em + 8 * ((100vw - 20em) / 80)); } } @media screen and (min-width: 100em) { div { width: 16em; } } -
indrekpaas revised this gist
Sep 30, 2015 . 2 changed files with 57 additions and 33 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -16,16 +16,22 @@ ======================================================================== */ @mixin fluid-type($properties, $min-vw, $max-vw, $min-value, $max-value) { & { @each $property in $properties { #{$property}: $min-value; } @media screen and (min-width: $min-vw) { @each $property in $properties { #{$property}: calc(#{$min-value} + #{strip-unit($max-value - $min-value)} * ((100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)})); } } @media screen and (min-width: $max-vw) { @each $property in $properties { #{$property}: $max-value; } } } } @@ -38,10 +44,18 @@ /* Single property */ html { @include fluid-type(font-size, 320px, 1366px, 14px, 18px); } /* Multiple properties with same values */ h1 { @include fluid-type(font-size margin-bottom, 320px, 1366px, 14px, 18px); } /* Multiple properties with different values */ div { @include fluid-type(padding, 320px, 1366px, 14px, 18px); @include fluid-type(width, 20em, 100em, 8em, 16em); } 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 charactersOriginal file line number Diff line number Diff line change @@ -10,34 +10,44 @@ `strip-unit()` function by Hugo Giraudel ======================================================================== */ /* Single property */ html { font-size: 14px; } @media screen and (min-width: 320px) { html { font-size: calc(14px + 4 * ((100vw - 320px) / 1046)); } } @media screen and (min-width: 1366px) { html { font-size: 18px; } } /* Multiple properties with same values */ h1 { font-size: 14px; margin-bottom: 14px; } @media screen and (min-width: 320px) { h1 { font-size: calc(14px + 4 * ((100vw - 320px) / 1046)); margin-bottom: calc(14px + 4 * ((100vw - 320px) / 1046)); } } @media screen and (min-width: 1366px) { h1 { font-size: 18px; margin-bottom: 18px; } } /* Multiple properties with different values */ div { padding: 14px; } @media screen and (min-width: 320px) { div { padding: calc(14px + 4 * ((100vw - 320px) / 1046)); } } @media screen and (min-width: 1366px) { div { padding: 18px; } } div { width: 8em; } @media screen and (min-width: 20em) { div { width: calc(8em + 8 * ((100vw - 20em) / 80)); } } @media screen and (min-width: 100em) { div { width: 16em; } } -
indrekpaas revised this gist
Sep 7, 2015 . 2 changed files with 5 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,5 @@ // ---- // libsass (v3.2.5) // ---- /*! ======================================================================== 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 charactersOriginal file line number Diff line number Diff line change @@ -13,11 +13,13 @@ html { font-size: 14px; } @media screen and (min-width: 320px) { html { font-size: calc(14px + 4 * ((100vw - 320px) / 1046)); } } @media screen and (min-width: 1366px) { html { font-size: 18px; @@ -27,11 +29,13 @@ html { div { width: 8em; } @media screen and (min-width: 32em) { div { width: calc(8em + 4 * ((100vw - 32em) / 32)); } } @media screen and (min-width: 64em) { div { width: 12em; -
indrekpaas revised this gist
Aug 1, 2015 . No changes.There are no files selected for viewing
-
indrekpaas revised this gist
Aug 1, 2015 . 2 changed files with 35 additions and 22 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -17,33 +17,32 @@ ======================================================================== */ @mixin fluid-type($min-vw, $max-vw, $min-value, $max-value, $property: font-size) { & { #{$property}: $min-value; @media screen and (min-width: $min-vw) { #{$property}: calc(#{$min-value} + #{strip-unit($max-value - $min-value)} * ((100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)})); } @media screen and (min-width: $max-vw) { #{$property}: $max-value; } } } @function strip-unit($value) { @return $value / ($value * 0 + 1); } html { @include fluid-type(320px, 1366px, 14px, 18px); } div { @include fluid-type(32em, 64em, 8em, 12em, width); } 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 charactersOriginal file line number Diff line number Diff line change @@ -23,3 +23,17 @@ html { font-size: 18px; } } div { width: 8em; } @media screen and (min-width: 32em) { div { width: calc(8em + 4 * ((100vw - 32em) / 32)); } } @media screen and (min-width: 64em) { div { width: 12em; } } -
indrekpaas revised this gist
Jun 10, 2015 . 1 changed file with 18 additions and 9 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -22,16 +22,25 @@ } @mixin fluid-type($min-vw, $max-vw, $min-font-size, $max-font-size) { $u1: unit($min-vw); $u2: unit($max-vw); $u3: unit($min-font-size); $u4: unit($max-font-size); @if $u1 == $u2 and $u1 == $u3 and $u1 == $u4 { & { font-size: $min-font-size; @media screen and (min-width: $min-vw) { font-size: calc(#{$min-font-size} + #{strip-unit($max-font-size - $min-font-size)} * ((100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)})); } @media screen and (min-width: $max-vw) { font-size: $max-font-size; } } } @else { @error "Detected mixed units. Please use the same units for all parameters."; } } -
indrekpaas revised this gist
Jun 10, 2015 . 2 changed files with 9 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -12,15 +12,21 @@ Inspired by Mike Riethmuller's Precise control over responsive typography http://madebymike.com.au/writing/precise-control-responsive-typography/ `strip-unit()` function by Hugo Giraudel ======================================================================== */ @function strip-unit($value) { @return $value / ($value * 0 + 1); } @mixin fluid-type($min-vw, $max-vw, $min-font-size, $max-font-size) { & { font-size: $min-font-size; @media screen and (min-width: $min-vw) { font-size: calc(#{$min-font-size} + #{strip-unit($max-font-size - $min-font-size)} * ((100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)})); } @media screen and (min-width: $max-vw) { 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 charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,8 @@ Inspired by Mike Riethmuller's Precise control over responsive typography http://madebymike.com.au/writing/precise-control-responsive-typography/ `strip-unit()` function by Hugo Giraudel ======================================================================== */ html { font-size: 14px; -
indrekpaas revised this gist
Jun 9, 2015 . 2 changed files with 5 additions and 19 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ // ---- // Sass (v3.4.14) // Compass (v1.0.3) // ---- @@ -12,17 +12,15 @@ Inspired by Mike Riethmuller's Precise control over responsive typography http://madebymike.com.au/writing/precise-control-responsive-typography/ ======================================================================== */ @mixin fluid-type($min-vw, $max-vw, $min-font-size, $max-font-size) { & { font-size: $min-font-size; @media screen and (min-width: $min-vw) { font-size: calc(#{$min-font-size} + #{($max-font-size - $min-font-size) / 1px} * ((100vw - #{$min-vw}) / #{($max-vw - $min-vw) / 1px})); } @media screen and (min-width: $max-vw) { @@ -31,16 +29,6 @@ } } html { @include fluid-type(320px, 1366px, 14px, 18px); } 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 charactersOriginal file line number Diff line number Diff line change @@ -7,15 +7,13 @@ Inspired by Mike Riethmuller's Precise control over responsive typography http://madebymike.com.au/writing/precise-control-responsive-typography/ ======================================================================== */ html { font-size: 14px; } @media screen and (min-width: 320px) { html { font-size: calc(14px + 4 * ((100vw - 320px) / 1046)); } } @media screen and (min-width: 1366px) { -
indrekpaas revised this gist
Jun 7, 2015 . 2 changed files with 6 additions and 6 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ // ---- // Sass (v3.4.13) // Compass (v1.0.3) // ---- @@ -42,5 +42,5 @@ html { @include fluid-type(320px, 1366px, 14px, 18px); } 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 charactersOriginal file line number Diff line number Diff line change @@ -13,13 +13,13 @@ html { font-size: 14px; } @media screen and (min-width: 320px) and (max-width: 1365px) { html { font-size: calc(14px + (18 - 14) * ((100vw - 320px) / (1366 - 320))); } } @media screen and (min-width: 1366px) { html { font-size: 18px; } } -
indrekpaas revised this gist
Apr 24, 2015 . 2 changed files with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -22,7 +22,7 @@ font-size: $min-font-size; @media screen and (min-width: $min-vw) and (max-width: $max-vw - 1) { font-size: calc(#{$min-font-size} + (#{strip-unit($max-font-size)} - #{strip-unit($min-font-size)}) * ((100vw - #{$min-vw}) / (#{strip-unit($max-vw)} - #{strip-unit($min-vw)}))); } @media screen and (min-width: $max-vw) { 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 charactersOriginal file line number Diff line number Diff line change @@ -15,7 +15,7 @@ html { } @media screen and (min-width: 320px) and (max-width: 1599px) { html { font-size: calc(14px + (24 - 14) * ((100vw - 320px) / (1600 - 320))); } } @media screen and (min-width: 1600px) { -
indrekpaas created this gist
Apr 24, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ // ---- // Sass (v3.4.12) // Compass (v1.0.3) // ---- /*! ======================================================================== PRECISE CONTROL OVER RESPONSIVE TYPOGRAPHY FOR SASS --------------------------------------------------- Author: Indrek Paas <@indrekpaas> Inspired by Mike Riethmuller's Precise control over responsive typography http://madebymike.com.au/writing/precise-control-responsive-typography/ `strip-unit()` function by Hugo Giraudel ======================================================================== */ @mixin fluid-type($min-vw, $max-vw, $min-font-size, $max-font-size) { & { font-size: $min-font-size; @media screen and (min-width: $min-vw) and (max-width: $max-vw - 1) { font-size: calc( #{$min-font-size} + ( #{strip-unit($max-font-size)} - #{strip-unit($min-font-size)} ) * ( ( 100vw - #{$min-vw} ) / ( #{strip-unit($max-vw)} - #{strip-unit($min-vw)} ) ) ); } @media screen and (min-width: $max-vw) { font-size: $max-font-size; } } } @function strip-unit($value) { @return $value / ($value * 0 + 1); } html { @include fluid-type(320px, 1600px, 14px, 24px); } 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ /*! ======================================================================== PRECISE CONTROL OVER RESPONSIVE TYPOGRAPHY FOR SASS --------------------------------------------------- Author: Indrek Paas <@indrekpaas> Inspired by Mike Riethmuller's Precise control over responsive typography http://madebymike.com.au/writing/precise-control-responsive-typography/ `strip-unit()` function by Hugo Giraudel ======================================================================== */ html { font-size: 14px; } @media screen and (min-width: 320px) and (max-width: 1599px) { html { font-size: calc( 14px + ( 24 - 14 ) * ( ( 100vw - 320px ) / ( 1600 - 320 ) ) ); } } @media screen and (min-width: 1600px) { html { font-size: 24px; } }