Last active
October 8, 2015 14:18
-
-
Save fastdivision/3344115 to your computer and use it in GitHub Desktop.
Useful Sass Mixins
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 characters
=font-family($family: "proxima-nova") | |
@if $family == "proxima-nova" | |
font-family: "proxima-nova", "Helvetica Neue", Helvetica, Arial, sans-serif | |
@if $family == "freight-sans" | |
font-family: "freight-sans-pro", "Helvetica Neue", Helvetica, Arial, sans-serif |
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 characters
html | |
font-size: 62.5% | |
body | |
font-size: 1.4rem // 14px | |
h1 | |
font-size: 2.4rem // 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 characters
html | |
font-size: 62.5% | |
body | |
+font-size(1.4) | |
h1 | |
+font-size(2.4) |
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 characters
=font-size($size: 1.6, $line: $size * 1.25) | |
font-size: ($size * 10) + px | |
line-height: ($line * 10) + px | |
font-size: $size + rem | |
line-height: $line + rem |
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 characters
#menu | |
float: right | |
max-width: 640px | |
@include respond-to($tablet-portrait) | |
margin-right: 20px | |
@include respond-to($phone) | |
margin-right: 10px |
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 characters
$phone: '(max-width: 480px)' | |
$tablet-portrait: '(max-width: 767px)' | |
$tablet-landscape-desktop: '(min-width: 768px) and (max-width: 979px)' | |
$large-desktop: '(min-width: 1200px)' | |
$non-retina: 'screen and (-webkit-max-device-pixel-ratio: 1)' | |
$retina: 'screen and (-webkit-min-device-pixel-ratio: 2)' | |
=respond-to($media) | |
@media #{$media} | |
@content |
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 characters
=phone | |
@media (max-width: 480px) | |
@content | |
#logo | |
max-width: 320px | |
@include phone | |
/* The CSS below will be added to @content */ | |
width: 120px |
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 characters
=hide-text() | |
font: 0/0 a | |
text-shadow: none | |
color: transparent |
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 characters
=mp0() | |
margin: 0 | |
padding: 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment