Skip to content

Instantly share code, notes, and snippets.

@craigmdennis
craigmdennis / clickability-on-label.scss
Last active August 29, 2015 14:17
Some helpful CSS tricks
// Show pointer on labels to indicate clickability
label {
cursor: pointer;
}
@craigmdennis
craigmdennis / SassMeister-input-HTML.html
Created March 14, 2015 01:05
Generated by SassMeister.com.
Hello World
@craigmdennis
craigmdennis / SassMeister-input.scss
Last active September 8, 2016 01:10
Generated by SassMeister.com.
// Buttons
// ".btn-{modifiername}", background-color, border, color
$buttons: (
("primary", #2F9ED8, #2886B7, #FFFFFF),
("secondary", #FFFFFF, #DDDDDD, #101010)
);
// Generate Button Modifiers
@each $b in $buttons {
.btn.btn-#{nth($b,1)} {
@craigmdennis
craigmdennis / media.scss
Created March 11, 2015 12:55
Flexbox media object with table-cell fallback
.media {
display: table;
display: flex;
align-items: flex-start;
}
.media-figure {
margin-right: $baseline;
}
@craigmdennis
craigmdennis / gulpfile.coffee
Created March 11, 2015 01:05
Deploy to GitHub pages with Gulp
"use strict"
# Include gulp
gulp = require 'gulp'
# Include Our Plugins
jshint = require 'gulp-jshint'
jade = require 'gulp-jade'
del = require 'del'
@craigmdennis
craigmdennis / jquery-plugin-template.coffee
Last active August 29, 2015 14:13 — forked from rjz/cs-jq-plugin-template.coffee
A class-based template for jQuery plugins in Coffeescript
# $('.target').myPlugin();
# $('.target').myPlugin({ paramA: 'not-foo' });
# $('.target').myPlugin('myMethod', 'Hello, world');
do($ = window.jQuery, window) ->
# Define the plugin class
class MyPlugin
defaults:
@craigmdennis
craigmdennis / breakpoints.scss
Last active February 13, 2016 14:47
SASS Variables with abstraction
$dre: 320px;
$diddy: 480px;
$jayz: 600px;
// Using breakpoint it’s as simple as
@include breakpoint( $dre ) {
width: 320px;
}
@craigmdennis
craigmdennis / conversion.scss
Last active December 28, 2016 06:19
PX to REM Sass conversion utility
// ===================================================
// Rem Conversion
// ===================================================
$pixelBase : 16;
@function parseInt($n) {
@return $n / ($n * 0 + 1);
}
@craigmdennis
craigmdennis / kirby-title.php
Last active August 29, 2015 14:10
Show all parent page titles in the HTML `<title>` tag using Kirby
<?php
// Start off with an empty $title
$title = '';
// Get all the parents (except the homepage) and reverse the array
$parents = $site->breadcrumb()->not('home')->flip();
// Iterate over the array
foreach ($parents AS $parent) :
@craigmdennis
craigmdennis / helpers.scss
Last active August 29, 2015 14:10
Toolkit: Common @Mixins and helpers commonly used in projects
%clearfix {
&:after {
content: "";
display: table;
clear: both;
}
}