Skip to content

Instantly share code, notes, and snippets.

View edwardhatricksmith's full-sized avatar

Edward Hatrick-Smith edwardhatricksmith

  • World Nomads Group
  • Sydney
View GitHub Profile
&--circle {
padding: .25em;
border-radius: 50%;
background-color: currentColor;
font-size: ($icon * $icon-circle);
overflow: visible;
&.Icon--lg {
font-size: ($icon-lg * $icon-circle);
}
.Icon {
display: inline-block;
height: 1em;
width: 1em;
vertical-align: middle;
// Size sub-modules
&--lg {
font-size: 2rem;
}
@edwardhatricksmith
edwardhatricksmith / svgicons-markup.html
Created August 13, 2018 03:36
Referencing icon sprite layers locally with xlink
<svg title="airplane icon" role="img">
<use xlink:href="#airplane"></use>
</svg>
@edwardhatricksmith
edwardhatricksmith / svgicons-dominject.html
Created August 13, 2018 03:20
Entry point for gulp-inject to inject an SVG sprite's XML into the DOM
<div class="is-hidden">
<!-- inject:sprite:svg -->
<!-- endinject -->
</div>
@edwardhatricksmith
edwardhatricksmith / svgicons-inject.js
Last active August 13, 2018 03:16
Config for gulp-inject to automate inlining SVG sprites
var inject = require('gulp-inject');
// Inject the sprite in the DOM
gulp.task('inject', ['sprite'], function() {
gulp
.src('./app/index.html')
.pipe(
inject(
gulp.src([
'app/sprite/icon-sprite.svg',
@edwardhatricksmith
edwardhatricksmith / svgicons-sprite.js
Last active August 13, 2018 03:10
Config for gulp-svg-sprite to compile an SVG sprite
var svgSprite = require('gulp-svg-sprite'),
// Set sprite config using symbole mode
spriteConfig = {
mode: {
symbol: {
dest: 'app/sprite',
prefix: '#Icon-',
sprite: 'icon-sprite',
example: false
.section {
margin-bottom: 2rem;
@include media-breakpoint-up(lg) {
margin-bottom: 2.5rem;
}
&--break {
padding-bottom: 1.5rem;
border-bottom: 1px solid $color-border;
<div class="section">
<!-- default spacing -->
</div>
<div class="section--large">
<!-- even greater spacing, perhaps for landing page content -->
</div>
<div class="section section--padding section--dark">
<!-- a section with a dark background colour and padded content -->
// .section continued...
// Add consistent padding to sections with background colours / images.
// We could use this as an %extend to apply to sections with backgrounds as well.
&--padded {
padding-bottom: 3rem;
padding-top: 3rem;
@include media-breakpoint-up(lg) {
padding-bottom: 4rem;
@edwardhatricksmith
edwardhatricksmith / section-base.scss
Last active July 9, 2018 03:59
Base section layout
.section {
margin-bottom: 2rem;
// Breakpoints used to scale the section proportionally on larger resolutions.
@include media-breakpoint-up(lg) {
margin-bottom: 2.5rem;
}
// Larger variation, perhaps for landing pages. You could also have a small, or an extra large.
&--large {