Created
June 27, 2017 01:39
-
-
Save dospuntocero/ea41d4f3432f4b28e8233268b848751f to your computer and use it in GitHub Desktop.
when you need to calculate measurements in vw, you need a context (starting point to define what will be 1vw) after that you pass the amount in pixels you want to convert to vws.
This file contains 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
$context:960;// size you want to start calculating | |
@function get-vw($target) { | |
$vw-context: ($context * .01) * 1px; | |
@return ($target/$vw-context) * 1vw; | |
} | |
//usage | |
.page-obituary{ | |
h1{ | |
color: #2b6295; | |
font-size: rem-calc(30); | |
line-height: 1; | |
margin-bottom: 0; | |
@include breakpoint(800){ | |
font-size: get-vw(30px); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment