Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Plugin Name: Gulp Sitemap Generator
* Plugin URI: https://gladdy.uk/blog/2014/04/13/using-uncss-and-grunt-uncss-with-wordpress/
* Description: Generate a JSON list of every page on a site so it can be used with Gulp and uncss.
* Author: Liam Gladdy
* Author URI: http://gladdy.co.uk
* Version: 1.0
*/
!function(e,t,n,s){"use strict";function i(e){var t=/fade/i.test(e),n=/pop/i.test(e);return{animate:t||n,pop:n,fade:t}}Foundation.libs.reveal={name:"reveal",version:"5.4.7",locked:!1,settings:{animation:"fadeAndPop",animation_speed:250,close_on_background_click:!0,close_on_esc:!0,dismiss_modal_class:"close-reveal-modal",bg_class:"reveal-modal-bg",root_element:"body",open:function(){},opened:function(){},close:function(){},closed:function(){},bg:e(".reveal-modal-bg"),css:{open:{opacity:0,visibility:"visible",display:"block"},close:{opacity:1,visibility:"hidden",display:"none"}}},init:function(t,n,s){e.extend(!0,this.settings,n,s),this.bindings(n,s)},events:function(){var e=this,t=e.S;return t(this.scope).off(".reveal").on("click.fndtn.reveal","["+this.add_namespace("data-reveal-id")+"]:not([disabled])",function(n){if(n.preventDefault(),!e.locked){var s=t(this),i=s.data(e.data_attr("reveal-ajax"));if(e.locked=!0,"undefined"==typeof i)e.open.call(e,s);else{var a=i===!0?s.attr("href"):i;e.open.call(e,s,{url:a})}}
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var del = require('del');
var sprite = require('css-sprite').stream;
var runSequence = require('run-sequence');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var lost = require('lost');
var appConfig = {
@corysimmons
corysimmons / gulpfile.js
Created April 19, 2015 18:22
Lost 6.0.0 gulpfile
var gulp = require('gulp'),
sourcemaps = require('gulp-sourcemaps'),
postcss = require('gulp-postcss'),
autoprefixer = require('gulp-autoprefixer'),
lost = require('lost');
var paths = {
cssSource: 'src/css',
cssDestination: 'dist/css'
};
@corysimmons
corysimmons / jeet-vs-lost.styl
Last active September 17, 2015 21:16
Simple syntax comparison of Jeet vs. Lost.
// Jeet
figure
col(1/2)
figure
col(1/2 1/2)
figure
col(1/2 1/2 1/2)
div
@corysimmons
corysimmons / SassMeister-input.scss
Created April 7, 2015 00:27
Generated by SassMeister.com.
// ----
// libsass (v3.1.0)
// ----
/// Sass can't split strings natively. Thanks to @HugoGiraudel for https://github.com/at-import/SassyLists
@function sl-explode($string, $delimiter: '', $separator: "space") {
@if type-of($string) != "string" {
@warn "`sl-explode` function expecting a string; #{type-of($string)} given.";
@return null;
@corysimmons
corysimmons / stylus-greater-than-x.md
Last active August 29, 2015 14:18
Just a collection of reasons I think other preprocessors are weaker than Stylus.

Note All 3 preprocessors have a great community of very hard-working/helpful people.

Speed

  • Both Sass and LESS are incredibly slow to process - especially when you're looping over things. Stylus is instantaneous.

Sass Can't

  • perform basic math like exponents with decimals
  • perform string operations like split()
  • compile fast. it's insanely slow anytime you have to process anything at all.
  • watch @import'd files for changes (maybe it can but I haven't found a way to)
block($fraction = 1)
$denominator = split('/', $fraction)
width: s('calc(100% * %s - (%s - %s / %s))', $fraction, $gut, $gut, $denominator)
block(1/4)
// Cannot call method 'split' of undefined

Pure SASS-adaption of Lea Verou's contrast-ratio javascript. Can be useful when eg. generating colored buttons from a single supplied color as you can then check which out of a couple of text colors would give the best contrast.

This script currently lacks the support for alpha-transparency that Lea supports in her script though.

In addition to the color-contrast adaption there's also some math methods that were needed to be able to calculate the exponent of a number and especially so when the exponent is a decimal number. A 2.4 exponent is used to calculate the luminance of a color and calculating such a thing is not something that SASS supports out of the box and not something I found a good pure-SASS script for calculating and I much prefer pure-SASS over ruby extensions. The math methods might perhaps be unecessary though if you're running Compass or similar as they may provide compatible math methods themselves.

Normal usage: `color: pick_best_color(#f00