This file contains hidden or 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
/*! | |
* gulp | |
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev | |
*/ | |
// Load plugins | |
var gulp = require('gulp'), | |
sass = require('gulp-ruby-sass'), | |
autoprefixer = require('gulp-autoprefixer'), | |
cssnano = require('gulp-cssnano'), |
This file contains hidden or 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
// Styles | |
gulp.task('styles', function() { | |
return gulp.src(config.sources.styles) | |
.pipe(sass({ errLogToConsole: true, outputStyle: 'expanded' })) | |
.pipe(prefix('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4')) | |
.pipe(gulpif(isProduction, mincss({ keepSpecialComments: 0 }))) | |
.pipe(header(banner)) | |
.pipe(gulp.dest(config.output.styles)) | |
.pipe(reload(server)); | |
}); |
This file contains hidden or 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
// Define your plugins here, make sure you have `gulp-util`... | |
var gutil = require('gulp-util'); | |
/** | |
* Define dev CLI flag | |
* Run `gulp --dev` | |
*/ | |
var isDev = gutil.env.dev; | |
gulp.task('scripts', function() { |
This file contains hidden or 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
function scrollTo(Y, duration, easingFunction, callback) { | |
var start = Date.now(), | |
elem = document.documentElement.scrollTop?document.documentElement:document.body, | |
from = elem.scrollTop; | |
if(from === Y) { | |
callback(); | |
return; /* Prevent scrolling to the Y point if already there */ | |
} |
This file contains hidden or 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
<?php | |
// All scripts to load here | |
function load_scripts() { | |
// Register script | |
wp_register_script('scrollup', get_template_directory_uri() . '/path/to/scripts/jquery.scrollUp.min.js', array('jquery'), '2.3.3', true ); | |
// Enqueue it | |
wp_enqueue_script('scrollup'); |
This file contains hidden or 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
<?php | |
add_filter( 'nav_menu_css_class', 'add_parent_url_menu_class', 10, 2 ); | |
function add_parent_url_menu_class( $classes = array(), $item = false ) { | |
// Get current URL | |
$current_url = current_url(); | |
// Get homepage URL |
This file contains hidden or 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
gulp.task('static', function() { | |
return gulp.src('src/static/**') | |
.pipe(gulp.dest('build')); | |
} |
This file contains hidden or 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
var paths = { | |
src: [ | |
'src/scripts/app/**/*module*.js', | |
'src/scripts/app/**/*.js' | |
], | |
dest: 'app/assets/scripts' | |
}; | |
gulp.task('scripts', function () { |
This file contains hidden or 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
function extend (target, source) { | |
var a = Object.create(target); | |
Object.keys(source).map(function (prop) { | |
a[prop] = source[prop]; | |
}); | |
return a; | |
}; |
This file contains hidden or 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
<p>Normal</p> | |
<a class="btn btn--primary">Button</a> | |
<a class="btn btn--primary btn--outline">Button</a> | |
<a class="btn btn--secondary">Button</a> | |
<a class="btn btn--secondary btn--outline">Button</a> | |
<a class="btn btn--tertiary">Button</a> | |
<a class="btn btn--tertiary btn--outline">Button</a> |
OlderNewer