View SassMeister-input.scss
// ----
// libsass (v3.2.5)
// ----
@mixin headings($from: 1, $to: 6) {
%headings-#{$from}-#{$to} {
@content
}
@if $from >= 1 and $to <= 6 {
View gulp-bower.js
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var bower = require('main-bower-files');
gulp.task('bower', function () {
return gulp.src(bower())
.pipe(concat('vendor.js'))
.pipe(uglify())
.pipe(gulp.dest('/build/scripts'));
View noRepeat.js
var noRepeat = function () {
return function (css) {
css.eachDecl('background-repeat', function (decl) {
if (decl.value.indexOf('none') !== -1) {
decl.value = 'no-repeat';
}
});
};
};
View headhesive-swap-image.js
{
onStick: function () {
document.querySelector('.img-elem').src = '/path/to/stick-img.png'
},
onUnstick: function () {
document.querySelector('.img-elem').src = '/path/to/unstick-img.png'
},
}
View Get structure pos.twig
{# Get the IDs of all the sections #}
{% set currentSectionId = entry.id %}
{% set allSectionIds = craft.entries.section('myStructure').level(1).ids() %}
{# Define var before loop #}
{% set sectionNumber = '' %}
{# Loop through all section IDs and find the one that matches the current #}
{% for key, sectionId in allSectionIds if sectionId == currentSectionId %}
View SassMeister-input-HTML.html
<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>
View SassMeister-input-HTML.html
<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>
View extend.js
function extend (target, source) {
var a = Object.create(target);
Object.keys(source).map(function (prop) {
a[prop] = source[prop];
});
return a;
};
View task.js
var paths = {
src: [
'src/scripts/app/**/*module*.js',
'src/scripts/app/**/*.js'
],
dest: 'app/assets/scripts'
};
gulp.task('scripts', function () {
View static.js
gulp.task('static', function() {
return gulp.src('src/static/**')
.pipe(gulp.dest('build'));
}