Skip to content

Instantly share code, notes, and snippets.

View mattanddesign's full-sized avatar

Matt Anderson mattanddesign

View GitHub Profile
@mattanddesign
mattanddesign / font-basic.scss
Created October 13, 2016 23:07
A good foundation for letting typography look consistent between browsers
body {
-webkit-font-smoothing: antialiased; /* Antialiasing for Webkit browsers */
-moz-osx-font-smoothing: grayscale; /* Antialiasing for Moz browsers */
-webkit-text-size-adjust: 100%; /* Correct rendering of font sizes on mobile Webkit devices */
font-feature-settings: "liga", "dlig"; /* Adds ligatures if font supports it */
}
@mattanddesign
mattanddesign / breakPoints.scss
Created October 13, 2016 21:53
Maintainable breakpoints using variables
// Break Points
// ==========================
$wall: 1400px;
$desk: 900px;
$lap: 600px;
h1 {
font-size: 3.2rem;
@mattanddesign
mattanddesign / zIndex-scale.scss
Created October 13, 2016 21:52
A maintainable z-index scale
// Z-index Scale
// ==========================
// Private vars
$zIndex-1: 100;
$zIndex-2: 200;
$zIndex-3: 300;
$zIndex-4: 400;
$zIndex-5: 500;
$zIndex-6: 600;
@mattanddesign
mattanddesign / font-sizing.css
Last active October 13, 2016 21:48
Font sizes which map to px values but still provide the benefits of scalable units.
html {
font-size: 62.5%; /* Sets default font size to 10px i.e. 16 * 62.5% = 10 */
}
body {
font-size: 1.4rem; /* Body font size is 14px */
}
h1 {
font-size: 3.2rem; /* H1 font size is 32px */
@mattanddesign
mattanddesign / HTML-close-entity.txt
Created October 10, 2016 10:16
HTML entity for close
×
body {
font-family: -apple-system,
BlinkMacSystemFont,
"Segoe UI",
Roboto,
Oxygen-Sans,
Ubuntu,
Cantarell,
"Helvetica Neue",
sans-serif;
@mattanddesign
mattanddesign / global.js
Last active August 1, 2016 12:27
If click target isn't within element do something
element.addEventListener('click', function(e) {
e.preventDefault();
if(this == e.target) {
// Trigger something
};
});