mirror of
https://github.com/kremalicious/blog.git
synced 2025-02-14 21:10:25 +01:00
add uncss
This commit is contained in:
parent
4b75b96cb5
commit
d99a4b93b0
@ -12,11 +12,11 @@ var Menu = (function(w, d) {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
// toggle menu
|
// toggle menu
|
||||||
thesite.toggleClass('menu-open');
|
thesite.toggleClass('has-menu-open');
|
||||||
|
|
||||||
// bind the hide controls
|
// bind the hide controls
|
||||||
$(document).bind('click.hidethepop', function() {
|
$(document).bind('click.hidethepop', function() {
|
||||||
thesite.removeClass('menu-open');
|
thesite.removeClass('has-menu-open');
|
||||||
// unbind the hide controls
|
// unbind the hide controls
|
||||||
$(document).unbind('click.hidethepop');
|
$(document).unbind('click.hidethepop');
|
||||||
});
|
});
|
||||||
|
@ -19,10 +19,10 @@ var Search = (function(w, d) {
|
|||||||
|
|
||||||
// show search field
|
// show search field
|
||||||
searcharea
|
searcharea
|
||||||
.removeClass('ready bounceOutUp')
|
.removeClass('is-ready animation-bounceOutUp')
|
||||||
.addClass('ready slideDown')
|
.addClass('is-ready animation-slideDown')
|
||||||
.on('animationend webkitAnimationEnd oAnimationEnd', function(){
|
.on('animationend webkitAnimationEnd oAnimationEnd', function(){
|
||||||
body.addClass('search-open');
|
body.addClass('has-search-open');
|
||||||
});
|
});
|
||||||
|
|
||||||
searchfield.focus();
|
searchfield.focus();
|
||||||
@ -30,8 +30,8 @@ var Search = (function(w, d) {
|
|||||||
_private.searchSimpleJekyllSearch();
|
_private.searchSimpleJekyllSearch();
|
||||||
|
|
||||||
// hide menu too just in case
|
// hide menu too just in case
|
||||||
if (body.hasClass('menu-open')) {
|
if (body.hasClass('has-menu-open')) {
|
||||||
body.removeClass('menu-open');
|
body.removeClass('has-menu-open');
|
||||||
}
|
}
|
||||||
|
|
||||||
// bind the hide controls
|
// bind the hide controls
|
||||||
@ -87,10 +87,10 @@ var Search = (function(w, d) {
|
|||||||
searchReset: function() {
|
searchReset: function() {
|
||||||
// revert all search elements
|
// revert all search elements
|
||||||
searcharea
|
searcharea
|
||||||
.removeClass('slideDown')
|
.removeClass('animation-slideDown')
|
||||||
.addClass('bounceOutUp')
|
.addClass('animation-bounceOutUp')
|
||||||
.on('animationend webkitAnimationEnd oAnimationEnd', function(){
|
.on('animationend webkitAnimationEnd oAnimationEnd', function(){
|
||||||
$('body').removeClass('search-open');
|
$('body').removeClass('has-search-open');
|
||||||
});
|
});
|
||||||
searchpop.addClass('hide');
|
searchpop.addClass('hide');
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ gpuacceleration()
|
|||||||
100%
|
100%
|
||||||
transform: none
|
transform: none
|
||||||
|
|
||||||
.slideDown
|
.animation-slideDown
|
||||||
animation: slideDown .2s both
|
animation: slideDown .2s both
|
||||||
|
|
||||||
// Up
|
// Up
|
||||||
@ -63,5 +63,5 @@ gpuacceleration()
|
|||||||
100%
|
100%
|
||||||
transform: translate3d(0, -100px, 0)
|
transform: translate3d(0, -100px, 0)
|
||||||
|
|
||||||
.bounceOutUp
|
.animation-bounceOutUp
|
||||||
animation: bounceOutUp .5s both
|
animation: bounceOutUp .5s both
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
@media $breakpoint2
|
@media $breakpoint2
|
||||||
transform: translate3d(0,-160px,0)
|
transform: translate3d(0,-160px,0)
|
||||||
|
|
||||||
.menu-open &
|
.has-menu-open &
|
||||||
transform: translate3d(0,0,0)
|
transform: translate3d(0,0,0)
|
||||||
|
|
||||||
@media only screen and (min-width: 40.625em) and (min-height: 650px)
|
@media only screen and (min-width: 40.625em) and (min-height: 650px)
|
||||||
@ -57,7 +57,7 @@
|
|||||||
margin-bottom: 420px
|
margin-bottom: 420px
|
||||||
transform: translate3d(0,0,0)
|
transform: translate3d(0,0,0)
|
||||||
|
|
||||||
.menu-open &
|
.has-menu-open &
|
||||||
transform: translate3d(0,140px,0)
|
transform: translate3d(0,140px,0)
|
||||||
|
|
||||||
.site__header,
|
.site__header,
|
||||||
@ -76,5 +76,5 @@
|
|||||||
bottom: 0
|
bottom: 0
|
||||||
box-shadow: none
|
box-shadow: none
|
||||||
|
|
||||||
.menu-open &
|
.has-menu-open &
|
||||||
hide()
|
hide()
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
opacity: 0
|
opacity: 0
|
||||||
|
|
||||||
.menu-open &
|
.has-menu-open &
|
||||||
opacity: 1
|
opacity: 1
|
||||||
|
|
||||||
.nav-link
|
.nav-link
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
// Search
|
// Search
|
||||||
//
|
//
|
||||||
|
|
||||||
.search-open
|
.has-search-open
|
||||||
overflow: hidden
|
overflow: hidden
|
||||||
|
|
||||||
.site__content
|
.site__content
|
||||||
@ -39,7 +39,7 @@
|
|||||||
// hidden by default
|
// hidden by default
|
||||||
display: none
|
display: none
|
||||||
|
|
||||||
&.ready
|
&.is-ready
|
||||||
display: block
|
display: block
|
||||||
|
|
||||||
|
|
||||||
|
12
gulpfile.js
12
gulpfile.js
@ -181,6 +181,17 @@ gulp.task('css', function() {
|
|||||||
.pipe(gulp.dest(DIST + '/assets/css/'))
|
.pipe(gulp.dest(DIST + '/assets/css/'))
|
||||||
});
|
});
|
||||||
|
|
||||||
|
gulp.task('uncss', function () {
|
||||||
|
if (isProduction) {
|
||||||
|
return gulp.src(DIST + '/assets/css/kremalicious3.min.css')
|
||||||
|
.pipe($.uncss({
|
||||||
|
html: [DIST + '/**/*.html'],
|
||||||
|
ignore: [/\.has\S+\W+\S+/, /is-ready/, /animation-slideDown/, /animation-bounceOutUp/, /transition/, /gpuacceleration/, /hide/, /show/, /search-popover/, /search-results/, /search-link/]
|
||||||
|
}))
|
||||||
|
.pipe(gulp.dest(DIST + '/assets/css'));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Scripts
|
// Scripts
|
||||||
@ -390,6 +401,7 @@ gulp.task('build', function(done) {
|
|||||||
'clean',
|
'clean',
|
||||||
'jekyll',
|
'jekyll',
|
||||||
['html', 'css', 'js', 'images', 'icons', 'fonts', 'media'],
|
['html', 'css', 'js', 'images', 'icons', 'fonts', 'media'],
|
||||||
|
'uncss',
|
||||||
'rev',
|
'rev',
|
||||||
'rev:replace',
|
'rev:replace',
|
||||||
done
|
done
|
||||||
|
@ -42,10 +42,11 @@
|
|||||||
"gulp-replace": ">=0.5.3",
|
"gulp-replace": ">=0.5.3",
|
||||||
"gulp-rev": ">=4.0.0",
|
"gulp-rev": ">=4.0.0",
|
||||||
"gulp-rev-replace": ">=0.4.1",
|
"gulp-rev-replace": ">=0.4.1",
|
||||||
"gulp-stylus": ">=2.0.3",
|
|
||||||
"gulp-sourcemaps": ">=1.6.0",
|
"gulp-sourcemaps": ">=1.6.0",
|
||||||
|
"gulp-stylus": ">=2.0.3",
|
||||||
"gulp-svg-sprite": ">=1.2.2",
|
"gulp-svg-sprite": ">=1.2.2",
|
||||||
"gulp-uglify": ">=1.2.0",
|
"gulp-uglify": ">=1.2.0",
|
||||||
|
"gulp-uncss": "^1.0.4",
|
||||||
"gulp-util": ">=3.0.6",
|
"gulp-util": ">=3.0.6",
|
||||||
"merge-stream": ">=0.1.7",
|
"merge-stream": ">=0.1.7",
|
||||||
"run-sequence": ">=1.1.0"
|
"run-sequence": ">=1.1.0"
|
||||||
|
Loading…
Reference in New Issue
Block a user