var gulp = require('gulp');
var gutil = require('gulp-util');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var autoprefixer = require('gulp-autoprefixer');
var merge = require('merge-stream');
var cleanCSS = require('gulp-clean-css');
var cssmin = require('gulp-cssmin');
⇐ back to the gist-blog at jrw.fi
Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.
I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.
This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso
<?php
// Your functions.php content
function has_children() {
global $post;
$pages = get_pages('child_of=' . $post->ID);
Reff: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#variable_defaults_
@function contentWidth(){
$n: (9px / 1170px * 100) + 0%;
@return ceil( (66.66666667% - $n) );
}
@include keyframe(fadeout) { | |
0% { | |
opacity: 1; | |
} | |
100% { | |
opacity: 0; | |
} | |
} |
/* 1. write it out for older browsers */ | |
/* 2. use the vendor prefix for webkit */ | |
/* 3. use the vendor prefix for moz */ | |
/* 4. include the un-prefixed version last */ | |
#foo { | |
width: 200px; | |
width: -webkit-calc(50% - 100px); | |
width: -moz-calc(50% - 100px); | |
width: calc(50% - 100px); |
#4 ways to get your portfolio noticed by clients https://99designs.com/blog/tips/better-portfolio-noticed-by-clients/
/* -------------------------------------------------------- */ | |
/* */ | |
/* A media query that captures: */ | |
/* */ | |
/* - Retina iOS devices */ | |
/* - Retina Macs running Safari */ | |
/* - High DPI Windows PCs running IE 8 and above */ | |
/* - Low DPI Windows PCs with IE zoomed in */ | |
/* - Android hdpi devices and above */ | |
/* - Android tvdpi devices, including Google Nexus 7 */ |
// Remove all P tags from shortcodes | |
<?php | |
add_filter("the_content", "the_content_filter"); | |
function the_content_filter($content) { | |
// array of custom shortcodes requiring the fix | |
$block = join("|",array("col","shortcode2","shortcode3")); |