diff --git a/build_ohana.sh b/build_ohana.sh index 296920c8567875291b739a8d52f33e13d2b5cb7b..66a7495c2dba14e887ed09c0dba3581526e6b6f4 100755 --- a/build_ohana.sh +++ b/build_ohana.sh @@ -77,9 +77,12 @@ echo "************************************************************************** echo "Done running npm install." echo "**************************************************************************************" -echo "Setting up es lint ..." +echo "Setting up es lint and gulp ..." rm .eslintignore ln -s ../.eslintignore .eslintignore +cp ../dashboard.js gulp-tasks +sed -i "3 i const { compileDashboard } = require('./gulp-tasks/dashboard');" gulpfile.js +sed -i "s/parallel(compileSass, compileJS)/parallel(compileSass, compileJS, compileDashboard)/g" gulpfile.js echo "**************************************************************************************" echo "Done setting up es lint." diff --git a/dashboard.js b/dashboard.js new file mode 100644 index 0000000000000000000000000000000000000000..0084a327f9c2973ec1ea1107df0c647696c4d7f7 --- /dev/null +++ b/dashboard.js @@ -0,0 +1,42 @@ +'use strict'; + +// Include gulp +const { src, dest } = require('gulp'); + +// Include Our Plugins +const sass = require('gulp-sass')(require('sass')); +const prefix = require('gulp-autoprefixer'); +const rename = require('gulp-rename'); +const minify = require('gulp-minify'); +const clean = require('gulp-clean-css'); + +/** + * Error handler function so we can see when errors happen. + * @param {object} err error that was thrown + * @returns {undefined} + */ +function handleError(err) { + // eslint-disable-next-line no-console + console.error(err.toString()); + this.emit('end'); +} + +// Export our tasks. +module.exports = { + + // Compile Sass. + compileDashboard: function () { + return src([ + './src/patterns/dashboard.scss' + ]) + .pipe(sass.sync({ + includePaths: ['node_modules'], + outputStyle: 'expanded' + }).on('error', handleError)) + .pipe(prefix({ cascade: false })) + .pipe(rename(function (path) { path.dirname = ''; return path;})) + .pipe(clean()) + .pipe(rename('uw-dashboard.min.css')) + .pipe(dest('./dist/css')); + } +}; diff --git a/src/patterns/03-layouts/block/_block.scss b/src/patterns/03-layouts/block/_block.scss index 5f4fef40a9be8cfa396527f0b9a1b417704c9480..41af0802c1129fc00a295d65f278af0ecf943147 100644 --- a/src/patterns/03-layouts/block/_block.scss +++ b/src/patterns/03-layouts/block/_block.scss @@ -5,6 +5,11 @@ .block { margin-bottom: var(--grid-gap); + .path-dashboard &, + &.block-page-title-block, + &.block-local-tasks-block { + margin-bottom: 0; + } } // disable margin for layout builder blocks diff --git a/src/patterns/dashboard.scss b/src/patterns/dashboard.scss new file mode 100644 index 0000000000000000000000000000000000000000..282899552284e98a46f36a3cba513f6ac9100c7e --- /dev/null +++ b/src/patterns/dashboard.scss @@ -0,0 +1,9 @@ +// @file +// Admin Dashboards styles + +@use '01-core/font-face' as *; +@use '01-core/props' as *; +@use '01-core/utilities' as *; +@use '03-layouts' as *; +@use '04-components/00-cms-styles/dashboards/dashboards' as *; +@use '04-components/form-view-search/form-view-search' as *;