Last active
March 19, 2018 01:04
-
-
Save webbower/eb9233d2ed73b4a00fbc13a6a919aa69 to your computer and use it in GitHub Desktop.
SASS Helper and Utils
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
// Functions | |
// https://css-tricks.com/snippets/sass/px-to-em-functions/ | |
@function emy($pixels, $context: $base-font-size) { | |
@if (unitless($pixels)) { | |
$pixels: $pixels * 1px; | |
} | |
@if (unitless($context)) { | |
$context: $context * 1px; | |
} | |
@return $pixels / $context * 1em; | |
} | |
//==== RESET | |
html { | |
box-sizing: border-box; | |
font-size: 16px; | |
font-family: sans-serif; | |
line-height: 1.5; | |
} | |
* { | |
&, | |
&:before, | |
&:after { | |
box-sizing: inherit; | |
} | |
} | |
body { | |
margin: 0; | |
} | |
// Button Reset | |
/* Reset <button> styles */ | |
// SEE https://stackoverflow.com/questions/16077341/how-to-reset-all-default-styles-of-the-html5-button-element#16077726 | |
button, | |
input[type=button], | |
input[type=reset], | |
input[type=submit] { | |
border: 0; | |
padding: 0; | |
background: none transparent; | |
cursor: pointer; | |
line-height: 1; | |
} | |
button, | |
input { | |
&::-moz-focus-inner { | |
border: 0; | |
padding: 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment