From e3f0887e4ce8d2af1e41b1c71b2f5cf0e099c4d1 Mon Sep 17 00:00:00 2001 From: Mark Moffat Date: Tue, 13 Feb 2018 22:15:14 +0100 Subject: [PATCH] Gulp now compressing theme CSS --- gulpfile.js | 19 ++++++++++++++----- views/themes/Cloth/style.min.css | 1 + views/themes/Material/style.min.css | 1 + 3 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 views/themes/Cloth/style.min.css create mode 100644 views/themes/Material/style.min.css diff --git a/gulpfile.js b/gulpfile.js index bd47307..2c73a05 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -15,11 +15,9 @@ gulp.task('compressJS', () => { .pipe(gulp.dest('public/javascripts')); }); -gulp.task('compressCSS', () => { +gulp.task('compressCss', () => { return gulp.src(['public/stylesheets/*.css', - '!public/stylesheets/*.min.css', - 'public/themes/*.css', - '!public/themes/*.min.css' + '!public/stylesheets/*.min.css' ]) .pipe(cleanCSS({compatibility: 'ie8'})) .pipe(rename({ @@ -29,7 +27,18 @@ gulp.task('compressCSS', () => { .pipe(gulp.dest('./')); }); +gulp.task('compressThemeCss', () => { + return gulp.src(['views/themes/**/*.css', + '!views/themes/**/*.min.css' + ]) + .pipe(cleanCSS({compatibility: 'ie8'})) + .pipe(rename({ + extname: '.min.css' + })) + .pipe(gulp.dest('views/themes/')); +}); + // run the tasks gulp.task('deploy', (callback) => { - runsequence('compressJS', 'compressCSS', callback); + runsequence('compressJS', 'compressCss', 'compressThemeCss', callback); }); diff --git a/views/themes/Cloth/style.min.css b/views/themes/Cloth/style.min.css new file mode 100644 index 0000000..b046b0d --- /dev/null +++ b/views/themes/Cloth/style.min.css @@ -0,0 +1 @@ +#frm_search,.search-bar-input,.search-bar-input .btn{padding-top:10px;height:45px}.searchMenuLocation-side{padding-right:0}.productsWrapper{padding-right:10px;padding-left:10px}.searchBarWrapper{padding-right:0;padding-left:0}.footer{padding-top:20px}.product-price{padding-bottom:0}.navbarMenuWrapper{background-color:#f5f5f5}.navbarMenu>ul>li>a:hover{color:#cc4135!important}.navbarMenu{padding-right:0;padding-left:0}.product_wrapper>a:hover{color:#cc4135!important}#navbar,#navbar>.navbar-nav,#navbar>.navbar-nav>li>a,.navbar-header,.navbar-static-top{margin-bottom:0;height:100px!important}#navbar>.navbar-nav>li>a{padding-top:35px}.pagination>li>a{background-color:#cc4135!important}.navbar-brand{color:#cc4135!important;letter-spacing:4px;padding-left:20px!important;padding-top:20px!important;height:100px!important;font-size:55px!important}.navbar-brand,.navbar-brand-image{height:80px;padding-left:10px;padding-top:10px}.navbar-default .badge{background-color:#cc4135}#empty-cart,.pushy-link{border-color:#e74c3c;background-color:#e74c3c}#empty-cart:active,#empty-cart:active:hover,#empty-cart:focus,#empty-cart:hover,.pushy-link:active,.pushy-link:active:hover,.pushy-link:focus,.pushy-link:hover{border-color:#cc4135;background-color:#cc4135}.navActive>a{margin-bottom:0;padding-top:15px;border-bottom:5px solid #e74c3c}#navbar,#navbar>.navbar-nav,#navbar>.navbar-nav>li>a,.navbar-header,.navbar-static-top{background-color:#fff}.navbar-default .navbar-nav>li>a{color:#838b8f;font-size:20px}@media only screen and (max-width:768px){.navbar-default .navbar-brand{padding-top:10px}.navbar-default .navbar-nav>li>a{font-size:16px}.searchBarWrapper{padding-top:10px}.navbarMenuWrapper{padding-left:0;padding-right:0}.navbarMenuOuter{padding-left:0;padding-right:0}.navActive>a{color:#fff!important}.navbarMenu{padding-right:7.5px;padding-left:7.5px}.navActive>a{color:#fff!important;background-color:#e74c3c;border-bottom:none}.footer{padding-top:10px}} \ No newline at end of file diff --git a/views/themes/Material/style.min.css b/views/themes/Material/style.min.css new file mode 100644 index 0000000..debcef8 --- /dev/null +++ b/views/themes/Material/style.min.css @@ -0,0 +1 @@ +@import url(https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css);a{color:#1565c0}.row .col{padding:0}fieldset{border:none}.pagelayout-wrapper{padding-top:30px;padding-bottom:30px}#frm_search,.search-bar-input,.search-bar-input .btn{padding-top:10px;height:45px}#frm_search{color:#000}input:not([type]):focus:not([readonly]),input[type=date]:not(.browser-default):focus:not([readonly]),input[type=datetime-local]:not(.browser-default):focus:not([readonly]),input[type=datetime]:not(.browser-default):focus:not([readonly]),input[type=email]:not(.browser-default):focus:not([readonly]),input[type=number]:not(.browser-default):focus:not([readonly]),input[type=password]:not(.browser-default):focus:not([readonly]),input[type=search]:not(.browser-default):focus:not([readonly]),input[type=tel]:not(.browser-default):focus:not([readonly]),input[type=text]:not(.browser-default):focus:not([readonly]),input[type=time]:not(.browser-default):focus:not([readonly]),input[type=url]:not(.browser-default):focus:not([readonly]),textarea.materialize-textarea:focus:not([readonly]){border-bottom:1px solid #1565c0;-webkit-box-shadow:0 1px 0 0 #1565c0;box-shadow:0 1px 0 0 #1565c0}input:not([type]):focus:not([readonly])+label,input[type=date]:not(.browser-default):focus:not([readonly])+label,input[type=datetime-local]:not(.browser-default):focus:not([readonly])+label,input[type=datetime]:not(.browser-default):focus:not([readonly])+label,input[type=email]:not(.browser-default):focus:not([readonly])+label,input[type=number]:not(.browser-default):focus:not([readonly])+label,input[type=password]:not(.browser-default):focus:not([readonly])+label,input[type=search]:not(.browser-default):focus:not([readonly])+label,input[type=tel]:not(.browser-default):focus:not([readonly])+label,input[type=text]:not(.browser-default):focus:not([readonly])+label,input[type=time]:not(.browser-default):focus:not([readonly])+label,input[type=url]:not(.browser-default):focus:not([readonly])+label,textarea.materialize-textarea:focus:not([readonly])+label{color:#1565c0}.searchMenuLocation-side{padding-right:0}.productsWrapper{padding-right:10px;padding-left:10px}.cart-body{padding:0}.searchBarWrapper{padding-right:0;padding-left:0}.content-body{margin-bottom:100px}.footer{padding-top:0}.footer h4{padding-top:25px;font-size:20px}.product-price{padding-bottom:0}.title-image-container{height:auto;margin-right:20px;margin-left:20px}.thumbnail-image{padding:20px}.image-next{right:5px}.image-prev{left:5px}.navbar{-webkit-box-shadow:none}.navbarMenuWrapper{background-color:#f5f5f5}.navbarMenu>ul>li>a:hover{color:#1565c0!important}.navbarMenu{padding-right:0;padding-left:0}.navbarMenu ul li{margin-bottom:5px}.navbarMenu ul li a{color:#000;font-size:18px}.product_wrapper>a:hover{color:#1565c0!important}#navbar,#navbar>.navbar-nav,#navbar>.navbar-nav>li>a,.navbar-header,.navbar-static-top{margin-bottom:0;height:100px!important}#navbar>.navbar-nav>li>a{padding-top:35px}#pager{margin-bottom:20px}.pagination>li>a{color:#000;background-color:#fff!important}.pagination>li>a:hover{color:#000}.pag-active a{color:#1565c0!important}.navbar-brand{color:#1565c0!important;letter-spacing:4px;padding-left:20px!important;padding-top:20px!important;height:100px!important;font-size:55px!important}.navbar-brand,.navbar-brand-image{height:80px;padding-left:10px;padding-top:10px}.navbar-default .badge{background-color:#1565c0}#empty-cart,.pushy-link{border-color:#1565c0;background-color:#1565c0}#empty-cart:active,#empty-cart:active:hover,#empty-cart:focus,#empty-cart:hover,.pushy-link:active,.pushy-link:active:hover,.pushy-link:focus,.pushy-link:hover{border-color:#1565c0;background-color:#1565c0}.navActive>a{color:#000;margin-bottom:0;border-bottom:5px solid #1565c0}#navbar,#navbar>.navbar-nav,#navbar>.navbar-nav>li>a,.navbar-header,.navbar-static-top{background-color:#fff}.navbar-default .navbar-nav>li>a{color:#838b8f;font-size:20px}.body_text{padding-top:30px!important}.product-option-text{padding-top:15px;padding-bottom:0}@media only screen and (max-width:768px){.navbar-default .navbar-brand{padding-top:10px}.navbar-default .navbar-nav>li>a{font-size:16px}.searchBarWrapper{padding-top:10px}.navbarMenuWrapper{padding-left:0;padding-right:0}.navbarMenuOuter{padding-left:0;padding-right:0}.navActive>a{color:#fff!important}.navbarMenu{padding-right:7.5px;padding-left:7.5px}.navActive>a{color:#fff!important;background-color:#1565c0;border-bottom:none}.footer{padding-top:10px}} \ No newline at end of file