This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// clean the generated icons directory that’s used with grunticon | |
clean: { | |
icons: ['<%= pathTo.jcrRoot %><%= pathTo.projectDesigns %>static/icons/dist/'] | |
}, | |
// minify SVGs | |
svgmin: { | |
options: { | |
plugins: [ | |
{ | |
removeViewBox: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Fallback for Inline SVG in HTML5</title> | |
<style type="text/css"> | |
.my-image { | |
background: url('my-image.jpg'); | |
width: 100px; | |
height: 100px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// here we assume support for SVG | |
.my-background-class { | |
background-image: url('my-icon.svg'); | |
// but if there’s no support, we use the PNG | |
.no-svgasimg & { | |
background-image: url('my-icon.png'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = function (grunt) { | |
// Show elapsed time after tasks run | |
require('time-grunt')(grunt); | |
// Load all Grunt tasks | |
require('load-grunt-tasks')(grunt); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "example-package-json", | |
"private": true, | |
"version": "0.1.0", | |
"description": "An example package.json for Five Good Reasons to Use Grunt for Front End CQ Development", | |
"devDependencies": { | |
"grunt": "^0.4.5", | |
"grunt-autoprefixer": "^1.0.1", | |
"grunt-concurrent": "^1.0.0", | |
"grunt-contrib-clean": "^0.6.0", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta name="twitter:card" content="summary"> | |
<meta name="twitter:site" content="@site_username"> | |
<meta name="twitter:creator" content="@creator_username"> | |
{% if page.title %} | |
<meta name="twitter:title" content="{{ page.title }}"> | |
{% else %} | |
<meta name="twitter:title" content="{{ site.title }}"> | |
{% endif %} | |
{% if page.url %} | |
<meta name="twitter:url" content="{{ site.url }}{{ page.url }}"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* a small mixin for easy use of rem with px as fallback | |
* usage: @include x-rem(font-size, 14px) | |
* usage: @include x-rem(marign, 0 12px 2 1.2) | |
* usage: @include x-rem(padding, 1.5 24px) | |
* | |
* thanks to Eric Meyer for https://github.com/ericam/susy | |
* and Hans Christian Reinl for http://drublic.de/blog/rem-fallback-sass-less/ | |
*/ | |
@mixin x-rem($property, $values) { |