Skip to content

Instantly share code, notes, and snippets.

View ahaywood's full-sized avatar

Amy Haywood Dutton ahaywood

View GitHub Profile
$types: 4;
$type-width: 20px;
@while $types > 0 {
.while—#{$types} {
width: $type-width + $types;
}
$types: $types - 1;
}
$list: “Amy”, “Henry”, “Isaac”, “Adele”;
@each $person in $list {
.avatar—#{$person} {
background: url(‘avatars/#{$person}.jpg”) no-repeat;
}
}
@ahaywood
ahaywood / _grid.scss
Created March 23, 2017 15:45
Sass @for loop to create a grid system
$class-slug: span !default;
@for $i from 1 through 4 {
.#{$class-slug}-#{$i} {
width: 60px + $i
}
}
@ahaywood
ahaywood / _conditional.scss
Created March 23, 2017 15:43
Sass Conditionals
$white-theme: true !default;
@if $white-theme {
@debug “we’re using the #{$white-theme}”;
background: white;
text: black;
} @else {
@debug “we’re using the #{$black-theme}”;
background: black;
text: white;
@ahaywood
ahaywood / _implementation.scss
Created March 23, 2017 15:42
z-index with Sass maps
.something {
z-index: map-get($zindex, change-your-world);
}
@ahaywood
ahaywood / _breakpoints.scss
Last active March 23, 2017 15:40
Setting up breakpoints
$breakpoints: (
small: 767px,
medium: 992px,
large: 1200px
);
// _mixins.scss
@mixin breakpoint($breakpoint) {
@if map-has-key($breakpoints, $breakpoint) {
@media (min-width: #{map-get($breakpoints, $breakpoint)}) {
@ahaywood
ahaywood / header.scss
Last active September 29, 2021 18:33
WordPress: Mega Menu
/*------------------------------------*\
#PRIMARY-MENU
\*------------------------------------*/
.primary-menu {
@include grid;
@include sans-serif;
font-weight: $bold;
height: $nav-bar-height;
&__wrapper {
@ahaywood
ahaywood / wordpress-hide-editor-on-pages.php
Created March 8, 2017 21:31 — forked from atomtigerzoo/wordpress-hide-editor-on-pages.php
Wordpress: Hide the editor on defined pages
/**
* Hide the main editor on specific pages
*/
define('EDITOR_HIDE_PAGE_TITLES', json_encode(array()));
define('EDITOR_HIDE_PAGE_TEMPLATES', json_encode(array('template-cars.php')));
/**
* Hide the main editor on defined pages
*
@ahaywood
ahaywood / README.md
Created August 26, 2016 03:57
Disable scroll zoom on embedded Google Maps
@ahaywood
ahaywood / .scss-lint.yml
Created August 26, 2016 03:44
YML: Scss Lint config
linters:
Indentation:
enabled: true
allow_non_nested_indentation: false
character: space # or 'tab'
width: 4
Comment:
allowed: '\/\*---(\*(?!\/)|[^*])*\*\/'