Optimize box-shadow of .site-brand-container

This commit is contained in:
Mimi 2020-08-19 13:26:38 +08:00
parent 60facf4b00
commit 402c34e9bb
5 changed files with 9 additions and 5 deletions

1
.github/labeler.yml vendored
View File

@ -5,3 +5,4 @@ Configurations: _config.yml
CSS: source/css/**/* CSS: source/css/**/*
📖 Docs: docs/**/* 📖 Docs: docs/**/*
Layout: layout/**/* Layout: layout/**/*
🌍 i18n: languages/**/*

View File

@ -853,6 +853,7 @@ canvas_ribbon:
vendors: vendors:
# The CDN provider of NexT internal scripts. # The CDN provider of NexT internal scripts.
# Available values: local | jsdelivr | unpkg # Available values: local | jsdelivr | unpkg
# Warning: If you are using the latest master branch of NexT, please set `internal: local`
internal: local internal: local
# The default CDN provider of third-party plugins. # The default CDN provider of third-party plugins.
# Available values: local | jsdelivr | unpkg | cdnjs # Available values: local | jsdelivr | unpkg | cdnjs

View File

@ -22,7 +22,7 @@
display: none; display: none;
} }
&.site-nav-on { .site-nav-on & {
display: block; display: block;
} }
} }

View File

@ -1,8 +1,10 @@
.site-brand-container { .site-brand-container {
background: $black-deep; background: $black-deep;
+tablet-mobile() { .site-nav-on & {
box-shadow: 0 0 16px rgba(0, 0, 0, .5); +tablet-mobile() {
box-shadow: 0 0 16px rgba(0, 0, 0, .5);
}
} }
} }

View File

@ -12,10 +12,10 @@ NexT.boot.registerEvents = function() {
event.currentTarget.classList.toggle('toggle-close'); event.currentTarget.classList.toggle('toggle-close');
const siteNav = document.querySelector('.site-nav'); const siteNav = document.querySelector('.site-nav');
if (!siteNav) return; if (!siteNav) return;
const animateAction = siteNav.classList.contains('site-nav-on'); const animateAction = document.body.classList.contains('site-nav-on');
const height = NexT.utils.getComputedStyle(siteNav); const height = NexT.utils.getComputedStyle(siteNav);
siteNav.style.height = animateAction ? height : 0; siteNav.style.height = animateAction ? height : 0;
const toggle = () => siteNav.classList.toggle('site-nav-on'); const toggle = () => document.body.classList.toggle('site-nav-on');
const begin = () => { const begin = () => {
siteNav.style.overflow = 'hidden'; siteNav.style.overflow = 'hidden';
}; };