Commit 51e3287f authored by iamdroid's avatar iamdroid

by iamdroid: Added breakpoints. Updated Gulp.

parent 49799fc9
# Supported browsers
> 1%
# Drupal theme watch/build with gulp
#
# get drupal version:
# drush st --format=list drupal-version
#
# Drupal 8, get theme name:
# drush cget system.theme default --format=string
#
# Drupal 8, get theme path:
# drush dd $(drush cget system.theme default --format=string)
#
# Drupal 8, run gulp:
# (cd $(drush dd $(drush cget system.theme default --format=string)) && gulp)
# or:
# gulp --cwd $(drush dd $(drush cget system.theme default --format=string))
#
# Drupal 8, run gulp build:
# (cd $(drush dd $(drush cget system.theme default --format=string)) && gulp build)
# or:
# gulp build --cwd $(drush dd $(drush cget system.theme default --format=string))
#
# Drupal 7, get theme name:
# drush vget theme_default --format=string
#
# Drupal 7, get theme path:
# drush dd $(drush vget theme_default --format=string)
#
# Drupal 7, run gulp:
# (cd $(drush dd $(drush vget theme_default --format=string)) && gulp)
# or:
# gulp --cwd $(drush dd $(drush vget theme_default --format=string))
#
# Drupal 7, run gulp:
# (cd $(drush dd $(drush vget theme_default --format=string)) && gulp build)
# or:
# gulp build --cwd $(drush dd $(drush vget theme_default --format=string))
#
# Zsh function:
function dtw() {
v=$(drush st --format=list drupal-version)
if [ ${v%%.*} -eq 8 ]; then
gulp --cwd $(drush dd $(drush cget system.theme default --format=string))
elif [ ${v%%.*} -eq 7 ]; then
gulp --cwd $(drush dd $(drush vget theme_default --format=string))
else
echo "Unsupported Drupal version";
fi
}
function dtb() {
v=$(drush st --format=list drupal-version)
if [ ${v%%.*} -eq 8 ]; then
gulp build --cwd $(drush dd $(drush cget system.theme default --format=string))
elif [ ${v%%.*} -eq 7 ]; then
gulp build --cwd $(drush dd $(drush vget theme_default --format=string))
else
echo "Unsupported Drupal version";
fi
}
This diff is collapsed.
......@@ -1527,8 +1527,6 @@ tr.selected:hover {
.form-item input[type="text"].error, .form-item input[type="email"].error, .form-item input[type="password"].error, .form-item input[type="search"].error, .form-item input[type="tel"].error, .form-item textarea.error, .form-item select.error {
border-bottom: 2px solid #f44336;
padding: 8px 0 7px; }
.form-item input[type="text"]::-webkit-input-placeholder, .form-item input[type="email"]::-webkit-input-placeholder, .form-item input[type="password"]::-webkit-input-placeholder, .form-item input[type="search"]::-webkit-input-placeholder, .form-item input[type="tel"]::-webkit-input-placeholder, .form-item textarea::-webkit-input-placeholder, .form-item select::-webkit-input-placeholder {
color: rgba(0, 0, 0, 0.26); }
.form-item input[type="text"]:-ms-input-placeholder, .form-item input[type="email"]:-ms-input-placeholder, .form-item input[type="password"]:-ms-input-placeholder, .form-item input[type="search"]:-ms-input-placeholder, .form-item input[type="tel"]:-ms-input-placeholder, .form-item textarea:-ms-input-placeholder, .form-item select:-ms-input-placeholder {
color: rgba(0, 0, 0, 0.26); }
.form-item input[type="text"]::-ms-input-placeholder, .form-item input[type="email"]::-ms-input-placeholder, .form-item input[type="password"]::-ms-input-placeholder, .form-item input[type="search"]::-ms-input-placeholder, .form-item input[type="tel"]::-ms-input-placeholder, .form-item textarea::-ms-input-placeholder, .form-item select::-ms-input-placeholder {
......@@ -2011,12 +2009,6 @@ navbar overlaying header-content (for sliders)
.card-bg-primary .block-search form .form-item input[type="search"] {
color: #FFF;
border-bottom: 1px solid #FFF; }
.navbar-item.block-search form .form-item input[type="text"]::-webkit-input-placeholder, .navbar-item.block-search form .form-item input[type="search"]::-webkit-input-placeholder,
#header .block-search form .form-item input[type="text"]::-webkit-input-placeholder,
#header .block-search form .form-item input[type="search"]::-webkit-input-placeholder,
.card-bg-primary .block-search form .form-item input[type="text"]::-webkit-input-placeholder,
.card-bg-primary .block-search form .form-item input[type="search"]::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.3); }
.navbar-item.block-search form .form-item input[type="text"]:-ms-input-placeholder, .navbar-item.block-search form .form-item input[type="search"]:-ms-input-placeholder,
#header .block-search form .form-item input[type="text"]:-ms-input-placeholder,
#header .block-search form .form-item input[type="search"]:-ms-input-placeholder,
......@@ -2081,12 +2073,6 @@ navbar overlaying header-content (for sliders)
.card-bg-primary .block-search.search-persistent form .form-item.focused input[type="text"],
.card-bg-primary .block-search.search-persistent form .form-item input[type="search"] {
color: rgba(0, 0, 0, 0.87); }
.navbar-item.block-search.search-persistent form .form-item.focused input[type="text"]::-webkit-input-placeholder, .navbar-item.block-search.search-persistent form .form-item input[type="search"]::-webkit-input-placeholder,
#header .block-search.search-persistent form .form-item.focused input[type="text"]::-webkit-input-placeholder,
#header .block-search.search-persistent form .form-item input[type="search"]::-webkit-input-placeholder,
.card-bg-primary .block-search.search-persistent form .form-item.focused input[type="text"]::-webkit-input-placeholder,
.card-bg-primary .block-search.search-persistent form .form-item input[type="search"]::-webkit-input-placeholder {
color: rgba(0, 0, 0, 0.26); }
.navbar-item.block-search.search-persistent form .form-item.focused input[type="text"]:-ms-input-placeholder, .navbar-item.block-search.search-persistent form .form-item input[type="search"]:-ms-input-placeholder,
#header .block-search.search-persistent form .form-item.focused input[type="text"]:-ms-input-placeholder,
#header .block-search.search-persistent form .form-item input[type="search"]:-ms-input-placeholder,
......@@ -2114,8 +2100,6 @@ navbar overlaying header-content (for sliders)
background: #FFF; }
.navbar-light:not(.theme-dark) .navbar-item.block-search.search-persistent form .form-item input[type="text"], .navbar-light:not(.theme-dark) .navbar-item.block-search.search-persistent form .form-item input[type="search"] {
color: rgba(0, 0, 0, 0.87); }
.navbar-light:not(.theme-dark) .navbar-item.block-search.search-persistent form .form-item input[type="text"]::-webkit-input-placeholder, .navbar-light:not(.theme-dark) .navbar-item.block-search.search-persistent form .form-item input[type="search"]::-webkit-input-placeholder {
color: rgba(0, 0, 0, 0.26); }
.navbar-light:not(.theme-dark) .navbar-item.block-search.search-persistent form .form-item input[type="text"]:-ms-input-placeholder, .navbar-light:not(.theme-dark) .navbar-item.block-search.search-persistent form .form-item input[type="search"]:-ms-input-placeholder {
color: rgba(0, 0, 0, 0.26); }
.navbar-light:not(.theme-dark) .navbar-item.block-search.search-persistent form .form-item input[type="text"]::-ms-input-placeholder, .navbar-light:not(.theme-dark) .navbar-item.block-search.search-persistent form .form-item input[type="search"]::-ms-input-placeholder {
......@@ -2206,11 +2190,9 @@ color themes
padding: 0; }
.card.card-vertical .card-column-left, .content-card .card-vertical.card-holder .card-column-left, .card.card-vertical .card-column-right, .content-card .card-vertical.card-holder .card-column-right {
padding: 24px; }
.card > .breadcrumbs:first-child, .content-card .card-holder > .breadcrumbs:first-child, .card > .title:first-child, .content-card .card-holder > .title:first-child, .card > .block:first-child, .content-card .card-holder > .block:first-child,
.card > div > .breadcrumbs:first-child,
.content-card .card-holder > div > .breadcrumbs:first-child, .card > div > .title:first-child, .content-card .card-holder > div > .title:first-child, .card > div > .block:first-child, .content-card .card-holder > div > .block:first-child {
.card > *:not(.card-item):first-child, .content-card .card-holder > *:not(.card-item):first-child, .card > div > .breadcrumbs:first-child, .content-card .card-holder > div > .breadcrumbs:first-child, .card > div > .title:first-child, .content-card .card-holder > div > .title:first-child, .card > div > .block:first-child, .content-card .card-holder > div > .block:first-child {
margin-top: 0 !important; }
.card > .block:last-child, .content-card .card-holder > .block:last-child, .card > div > .block:last-child, .content-card .card-holder > div > .block:last-child {
.card > *:not(.card-item):last-child, .content-card .card-holder > *:not(.card-item):last-child, .card > div > .block:last-child, .content-card .card-holder > div > .block:last-child {
margin-bottom: 0 !important; }
.card-main, .content-card .card-holder {
......@@ -2317,13 +2299,13 @@ color themes
margin: 8px; }
.card-text {
padding: 16px 24px 8px 24px; }
.card-text:last-child {
padding-bottom: 16px; }
padding: 16px 24px; }
.card-title + .card-text {
padding-top: 0; }
.card-title.divider-bottom + .card-text, .card-title + .card-text.divider-top {
padding-top: 16px; }
.card-text > *:last-child {
margin-bottom: 0; }
.card-bg-red {
background-color: #f44336;
......
......@@ -140,8 +140,6 @@
border-bottom-color: rgba(255, 255, 255, 0.12); }
.theme-dark .form-item input[type="text"]:focus, .theme-dark .form-item input[type="text"].error:focus, .theme-dark .form-item input[type="email"]:focus, .theme-dark .form-item input[type="email"].error:focus, .theme-dark .form-item input[type="password"]:focus, .theme-dark .form-item input[type="password"].error:focus, .theme-dark .form-item input[type="search"]:focus, .theme-dark .form-item input[type="search"].error:focus, .theme-dark .form-item input[type="tel"]:focus, .theme-dark .form-item input[type="tel"].error:focus, .theme-dark .form-item textarea:focus, .theme-dark .form-item textarea.error:focus, .theme-dark .form-item select:focus, .theme-dark .form-item select.error:focus {
border-bottom-color: #40c4ff; }
.theme-dark .form-item input[type="text"]::-webkit-input-placeholder, .theme-dark .form-item input[type="email"]::-webkit-input-placeholder, .theme-dark .form-item input[type="password"]::-webkit-input-placeholder, .theme-dark .form-item input[type="search"]::-webkit-input-placeholder, .theme-dark .form-item input[type="tel"]::-webkit-input-placeholder, .theme-dark .form-item textarea::-webkit-input-placeholder, .theme-dark .form-item select::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.3); }
.theme-dark .form-item input[type="text"]:-ms-input-placeholder, .theme-dark .form-item input[type="email"]:-ms-input-placeholder, .theme-dark .form-item input[type="password"]:-ms-input-placeholder, .theme-dark .form-item input[type="search"]:-ms-input-placeholder, .theme-dark .form-item input[type="tel"]:-ms-input-placeholder, .theme-dark .form-item textarea:-ms-input-placeholder, .theme-dark .form-item select:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.3); }
.theme-dark .form-item input[type="text"]::-ms-input-placeholder, .theme-dark .form-item input[type="email"]::-ms-input-placeholder, .theme-dark .form-item input[type="password"]::-ms-input-placeholder, .theme-dark .form-item input[type="search"]::-ms-input-placeholder, .theme-dark .form-item input[type="tel"]::-ms-input-placeholder, .theme-dark .form-item textarea::-ms-input-placeholder, .theme-dark .form-item select::-ms-input-placeholder {
......@@ -189,8 +187,6 @@
color: rgba(255, 255, 255, 0.7); }
.theme-dark .block-search.search-persistent form .form-item.focused input[type="text"], .theme-dark .block-search.search-persistent form input[type="search"] {
color: rgba(0, 0, 0, 0.87); }
.theme-dark .block-search.search-persistent form .form-item.focused input[type="text"]::-webkit-input-placeholder, .theme-dark .block-search.search-persistent form input[type="search"]::-webkit-input-placeholder {
color: rgba(0, 0, 0, 0.26); }
.theme-dark .block-search.search-persistent form .form-item.focused input[type="text"]:-ms-input-placeholder, .theme-dark .block-search.search-persistent form input[type="search"]:-ms-input-placeholder {
color: rgba(0, 0, 0, 0.26); }
.theme-dark .block-search.search-persistent form .form-item.focused input[type="text"]::-ms-input-placeholder, .theme-dark .block-search.search-persistent form input[type="search"]::-ms-input-placeholder {
......
var gulp = require('gulp');
var watch = require('gulp-watch');
var batch = require('gulp-batch');
var sass = require('gulp-sass');
var sasslint = require('gulp-sass-lint');
var eslint = require('gulp-eslint');
......@@ -17,62 +15,56 @@ var sassOptions = {
includePaths: ['./node_modules/breakpoint-sass/stylesheets']
};
var autoprefixerOptions = {
browsers: ['> 1%']
};
// tasks
gulp.task('sass', function () {
return gulp.src(SASS + '/**/*.scss')
gulp.task('sass', done => {
gulp.src(SASS + '/**/*.scss')
.pipe(sourcemaps.init())
.pipe(sass.sync(sassOptions).on('error', sass.logError))
.pipe(autoprefixer(autoprefixerOptions))
.pipe(autoprefixer({}))
.pipe(sourcemaps.write('../css'))
.pipe(gulp.dest(CSS));
done();
});
gulp.task('sass-lint', function () {
return gulp.src(SASS + '/**/*.scss')
gulp.task('sass-lint', done => {
gulp.src(SASS + '/**/*.scss')
.pipe(sasslint())
.pipe(sasslint.format())
.pipe(sasslint.failOnError());
.pipe(sasslint.failOnError())
done();
});
gulp.task('js-lint', function () {
return gulp.src(JS + '/**/*.js')
gulp.task('js-lint', done => {
gulp.src(JS + '/**/*.js')
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
.pipe(eslint.failAfterError())
done();
});
gulp.task('imagemin', function() {
gulp.task('imagemin', done => {
gulp.src(IMG + '/src/*')
.pipe(imagemin())
.pipe(gulp.dest(IMG));
done();
});
// build without lint
gulp.task('build', ['sass', 'imagemin']);
gulp.task('build', gulp.series('sass', 'imagemin'));
gulp.task('watch', function () {
watch(SASS + '/**/*.scss', batch(function (events, done) {
gulp.start('build', done);
}));
return gulp.watch(SASS + '/**/*.scss', gulp.series(gulp.series('sass', 'imagemin')));
});
// build with lint
gulp.task('build-lint', ['sass-lint', 'sass', 'imagemin', 'js-lint']);
gulp.task('build-lint', gulp.series('sass-lint', 'sass', 'imagemin', 'js-lint'));
gulp.task('watch-lint', function () {
watch(SASS + '/**/*.scss', batch(function (events, done) {
gulp.start('build-int', done);
}));
return gulp.watch(SASS + '/**/*.scss', gulp.series(gulp.series('sass-lint', 'sass', 'imagemin', 'js-lint')));
});
// default task
gulp.task('default', ['build', 'watch']);
//gulp.task('default', ['build-lint', 'watch-lint']);
gulp.task('default', gulp.series('build', 'watch'));
// gulp.task('default', gulp.series('build-lint', 'watch-lint'));
# layout
material_base.layout.min-xs:
label: "min-xs, min-mobiles"
mediaQuery: ''
weight: 0
multipliers:
- 1x
group: material_base.layout
material_base.layout.ss:
label: "ss, min-mobiles-small"
mediaQuery: 'all and (min-width: 360px)'
weight: 1
multipliers:
- 1x
group: material_base.layout
material_base.layout.ms:
label: "ms, min-mobiles-medium"
mediaQuery: 'all and (min-width: 480px)'
weight: 2
multipliers:
- 1x
group: material_base.layout
material_base.layout.xs:
label: "xs, min-mobiles-large"
mediaQuery: 'all and (min-width: 568px)'
weight: 3
multipliers:
- 1x
group: material_base.layout
material_base.layout.max-sm:
label: "max-sm, mobiles-only, max-mobiles"
mediaQuery: 'all and (max-width: 767px)'
weight: 4
multipliers:
- 1x
group: material_base.layout
material_base.layout.sm:
label: "sm, min-tablets, min-tablets-modern"
mediaQuery: 'all and (min-width: 768px)'
weight: 5
multipliers:
- 1x
group: material_base.layout
material_base.layout.only-sm:
label: "only-sm, tablets-only"
mediaQuery: 'all and (min-width: 768px) and (max-width: 991px)'
weight: 6
multipliers:
- 1x
group: material_base.layout
material_base.layout.max-md:
label: "max-md, max-tablets"
mediaQuery: 'all and (max-width: 991px)'
weight: 7
multipliers:
- 1x
group: material_base.layout
material_base.layout.md:
label: "md, min-desktops, desktops-only"
mediaQuery: 'all and (min-width: 992px)'
weight: 8
multipliers:
- 1x
group: material_base.layout
material_base.layout.only-smx:
label: "only-smx, tablets-modern-only"
mediaQuery: 'all and (min-width: 768px) and (max-width: 1255px)'
weight: 9
multipliers:
- 1x
group: material_base.layout
material_base.layout.max-lg:
label: "max-lg, max-tablets-modern"
mediaQuery: 'all and (max-width: 1255px)'
weight: 10
multipliers:
- 1x
group: material_base.layout
material_base.layout.lg:
label: "lg, min-desktops-modern, desktops-modern-only"
mediaQuery: 'all and (min-width: 1256px)'
weight: 11
multipliers:
- 1x
group: material_base.layout
material_base.layout.xl:
label: "xl, min-desktops-medium"
mediaQuery: 'all and (min-width: 1520px)'
weight: 12
multipliers:
- 1x
group: material_base.layout
material_base.layout.ll:
label: "ll, min-desktops-large"
mediaQuery: 'all and (min-width: 1920px)'
weight: 13
multipliers:
- 1x
group: material_base.layout
# images
material_base.image.min-xs:
label: "min-xs, min-mobiles"
mediaQuery: ''
weight: 0
multipliers:
- 1x
- 1.5x
- 2x
- 2.5x
- 3x
group: material_base.image
material_base.image.ss:
label: "ss, min-mobiles-small"
mediaQuery: 'all and (min-width: 360px)'
weight: 1
multipliers:
- 1x
- 1.5x
- 2x
- 2.5x
- 3x
group: material_base.image
material_base.image.ms:
label: "ms, min-mobiles-medium"
mediaQuery: 'all and (min-width: 480px)'
weight: 2
multipliers:
- 1x
- 1.5x
- 2x
- 2.5x
- 3x
group: material_base.image
material_base.image.xs:
label: "xs, min-mobiles-large"
mediaQuery: 'all and (min-width: 568px)'
weight: 3
multipliers:
- 1x
- 1.5x
- 2x
- 2.5x
- 3x
group: material_base.image
material_base.image.max-sm:
label: "max-sm, mobiles-only, max-mobiles"
mediaQuery: 'all and (max-width: 767px)'
weight: 4
multipliers:
- 1x
- 1.5x
- 2x
- 2.5x
- 3x
group: material_base.image
material_base.image.sm:
label: "sm, min-tablets, min-tablets-modern"
mediaQuery: 'all and (min-width: 768px)'
weight: 5
multipliers:
- 1x
- 2x
group: material_base.image
material_base.image.only-sm:
label: "only-sm, tablets-only"
mediaQuery: 'all and (min-width: 768px) and (max-width: 991px)'
weight: 6
multipliers:
- 1x
- 2x
group: material_base.image
material_base.image.max-md:
label: "max-md, max-tablets"
mediaQuery: 'all and (max-width: 991px)'
weight: 7
multipliers:
- 1x
- 2x
group: material_base.image
material_base.image.md:
label: "md, min-desktops, desktops-only"
mediaQuery: 'all and (min-width: 992px)'
weight: 8
multipliers:
- 1x
- 2x
group: material_base.image
material_base.image.only-smx:
label: "only-smx, tablets-modern-only"
mediaQuery: 'all and (min-width: 768px) and (max-width: 1255px)'
weight: 9
multipliers:
- 1x
- 2x
group: material_base.image
material_base.image.max-lg:
label: "max-lg, max-tablets-modern"
mediaQuery: 'all and (max-width: 1255px)'
weight: 10
multipliers:
- 1x
- 2x
group: material_base.image
material_base.image.lg:
label: "lg, min-desktops-modern, desktops-modern-only"
mediaQuery: 'all and (min-width: 1256px)'
weight: 11
multipliers:
- 1x
- 2x
group: material_base.image
material_base.image.xl:
label: "xl, min-desktops-medium"
mediaQuery: 'all and (min-width: 1520px)'
weight: 12
multipliers:
- 1x
- 2x
group: material_base.image
material_base.image.ll:
label: "ll, min-desktops-large"
mediaQuery: 'all and (min-width: 1920px)'
weight: 13
multipliers:
- 1x
- 2x
group: material_base.image
This diff is collapsed.
{
"name": "material_base",
"version": "1.6.0",
"version": "1.7.0",
"description": "Drupal theme.",
"main": "index.js",
"main": "gulpfile.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
......@@ -12,21 +12,23 @@
},
"author": "iamdroid",
"license": "ISC",
"bugs": {
"url": "https://github.com/i-amdroid/material_base/issues"
},
"homepage": "https://mb.4dd.pw/",
"devDependencies": {
"breakpoint-sass": "^2.7.1",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-react": "^7.11.1",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^5.0.0",
"gulp-batch": "^1.0.5",
"gulp-changed": "^3.2.0",
"eslint-plugin-import": "^2.17.3",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.13.0",
"gulp": "^4.0.2",
"gulp-autoprefixer": "^6.1.0",
"gulp-changed": "^4.0.0",
"gulp-eslint": "^5.0.0",
"gulp-imagemin": "^4.1.0",
"gulp-imagemin": "^6.0.0",
"gulp-sass": "^4.0.2",
"gulp-sass-lint": "^1.4.0",
"gulp-sourcemaps": "^2.6.4",
"gulp-watch": "^5.0.1"
"gulp-sourcemaps": "^2.6.5"
}
}
......@@ -836,9 +836,8 @@ $primary-colors: (
&.card-vertical { padding: 0; //display: flex;
.card-column-left, .card-column-right { padding: 24px; }
} // TDV
& > .breadcrumbs:first-child, & > .title:first-child, & > .block:first-child,
& > div > .breadcrumbs:first-child, & > div > .title:first-child, & > div > .block:first-child { margin-top: 0 !important; }
& > .block:last-child, & > div > .block:last-child { margin-bottom: 0 !important; }
& > *:not(.card-item):first-child, & > div > .breadcrumbs:first-child, & > div > .title:first-child, & > div > .block:first-child { margin-top: 0 !important; } // D7
& > *:not(.card-item):last-child, & > div > .block:last-child { margin-bottom: 0 !important; } // D7
}
.card-main { background: $color-bg-card; border-bottom: 1px solid $color-divider; margin-left: -$gutter / 1.5; margin-right: -$gutter / 1.5; padding: $gutter / 1.5;
@include z-level-0; border-radius: 0; } // TDV
......@@ -883,10 +882,10 @@ $primary-colors: (
.action-item { display: inline-block; height: 36px; line-height: 20px; padding: 8px 16px; margin: 8px; }
}
.card-text { padding: 16px 24px 8px 24px;
&:last-child { padding-bottom: 16px; }
.card-text { padding: 16px 24px;
.card-title + & { padding-top: 0; }
.card-title.divider-bottom + &, .card-title + &.divider-top { padding-top: 16px; }
& > *:last-child { margin-bottom: 0; }
}
@each $color-name, $color-value in $primary-colors {
......
js/animation.js
js/jquery.mobile-events.min.js
js/jquery.ripple.js
js/misc.js
js/prism.js
# Drupal theme watch/build with gulp
#
# get drupal version:
# drush st --format=list drupal-version
#
# Drupal 8, get theme name:
# drush cget system.theme default --format=string
#
# Drupal 8, get theme path:
# drush dd $(drush cget system.theme default --format=string)
#
# Drupal 8, run gulp:
# (cd $(drush dd $(drush cget system.theme default --format=string)) && gulp)
# or:
# gulp --cwd $(drush dd $(drush cget system.theme default --format=string))
#
# Drupal 8, run gulp build:
# (cd $(drush dd $(drush cget system.theme default --format=string)) && gulp build)
# or:
# gulp build --cwd $(drush dd $(drush cget system.theme default --format=string))
#
# Drupal 7, get theme name:
# drush vget theme_default --format=string
#
# Drupal 7, get theme path:
# drush dd $(drush vget theme_default --format=string)
#
# Drupal 7, run gulp:
# (cd $(drush dd $(drush vget theme_default --format=string)) && gulp)
# or:
# gulp --cwd $(drush dd $(drush vget theme_default --format=string))
#
# Drupal 7, run gulp:
# (cd $(drush dd $(drush vget theme_default --format=string)) && gulp build)
# or:
# gulp build --cwd $(drush dd $(drush vget theme_default --format=string))
#
# Zsh function:
function dtw() {
v=$(drush st --format=list drupal-version)
if [ ${v%%.*} -eq 8 ]; then
gulp --cwd $(drush dd $(drush cget system.theme default --format=string))
elif [ ${v%%.*} -eq 7 ]; then
gulp --cwd $(drush dd $(drush vget theme_default --format=string))
else
echo "Unsupported Drupal version";
fi
}
function dtb() {
v=$(drush st --format=list drupal-version)
if [ ${v%%.*} -eq 8 ]; then
gulp build --cwd $(drush dd $(drush cget system.theme default --format=string))
elif [ ${v%%.*} -eq 7 ]; then
gulp build --cwd $(drush dd $(drush vget theme_default --format=string))
else
echo "Unsupported Drupal version";
fi
}
var gulp = require('gulp');
var watch = require('gulp-watch');
var batch = require('gulp-batch');
var sass = require('gulp-sass');
var sasslint = require('gulp-sass-lint');
var eslint = require('gulp-eslint');
......@@ -17,62 +15,56 @@ var sassOptions = {
includePaths: ['./node_modules/breakpoint-sass/stylesheets']
};
var autoprefixerOptions = {
browsers: ['> 1%']
};
// tasks
gulp.task('sass', function () {
return gulp.src(SASS + '/**/*.scss')
gulp.task('sass', done => {
gulp.src(SASS + '/**/*.scss')
.pipe(sourcemaps.init())
.pipe(sass.sync(sassOptions).on('error', sass.logError))
.pipe(autoprefixer(autoprefixerOptions))
.pipe(autoprefixer({}))
.pipe(sourcemaps.write('../css'))
.pipe(gulp.dest(CSS));
done();