From 0b6780677c2e211c091bcb12c865d4f2bbd607ca Mon Sep 17 00:00:00 2001 From: zzossig Date: Fri, 24 Jan 2020 16:05:56 +0900 Subject: [PATCH] tab bug fixed --- assets/sass/abstracts/_variables.scss | 1 + assets/sass/base/_reset.scss | 2 +- assets/sass/components/_breadcrumb.scss | 1 + assets/sass/components/_notice.scss | 8 ++++---- assets/sass/components/_summary.scss | 2 +- assets/sass/pages/_contact.scss | 2 +- assets/sass/pages/_gallery.scss | 2 +- assets/sass/pages/_list.scss | 2 +- assets/sass/pages/_showcase.scss | 2 +- assets/sass/pages/_single.scss | 7 +++++-- layouts/partials/head/scripts.html | 20 +++++++++++++++++++- 11 files changed, 36 insertions(+), 13 deletions(-) diff --git a/assets/sass/abstracts/_variables.scss b/assets/sass/abstracts/_variables.scss index 8d60315..0d269e9 100644 --- a/assets/sass/abstracts/_variables.scss +++ b/assets/sass/abstracts/_variables.scss @@ -2,6 +2,7 @@ $text-font-stack: BlinkMacSystemFont, -apple-system, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif !default; $code-font-stack: Consolas, Monaco, Menlo, "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", "Lucida Console", "Lucida Sans Typewriter", "Liberation Mono", "Nimbus Mono L", Monaco, Courier, monospace !default; +$contents-font-stack: system, -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif !default; $z-indexes: ("modal", "navbar", "dropdown", "header", "gtt", "clipboard", "grid", "search-btn", "search", "content", "footer", "taxo", "toc", "gallery-mask", "card-outter", "card-inner"); diff --git a/assets/sass/base/_reset.scss b/assets/sass/base/_reset.scss index 787000b..09c935a 100644 --- a/assets/sass/base/_reset.scss +++ b/assets/sass/base/_reset.scss @@ -118,7 +118,7 @@ dfn { font-style: italic; } -figcaption { +figcaption { font-style: italic; font-size: 0.9rem; margin-top: 0.5rem; diff --git a/assets/sass/components/_breadcrumb.scss b/assets/sass/components/_breadcrumb.scss index d035a12..f26256e 100644 --- a/assets/sass/components/_breadcrumb.scss +++ b/assets/sass/components/_breadcrumb.scss @@ -1,5 +1,6 @@ .breadcrumb { margin: 1rem; + margin-bottom: 0; padding: 0.5rem; border-radius: 0.25rem; padding: auto; diff --git a/assets/sass/components/_notice.scss b/assets/sass/components/_notice.scss index 961bd5d..9ff6eec 100644 --- a/assets/sass/components/_notice.scss +++ b/assets/sass/components/_notice.scss @@ -27,7 +27,7 @@ border-top: 30px solid #f1b37e; background: #fefaf5; color: rgba(150, 90, 38, 0.995) !important; - font-family: $content-font; + font-family: $contents-font-stack; &:first-child::after { content: 'Info'; @@ -39,7 +39,7 @@ border-top: 30px solid #d58181; background: #fbeded; color: rgba(132, 56, 56, 0.995) !important; - font-family: $content-font; + font-family: $contents-font-stack; &:first-child::after { content: 'Warning'; @@ -51,7 +51,7 @@ border-top: 30px solid #6bb1e0; background: #e6f3fb; color: rgba(47, 103, 141, 0.995) !important; - font-family: $content-font; + font-family: $contents-font-stack; &:first-child::after { content: 'Note'; @@ -63,7 +63,7 @@ border-top: 30px solid #84c578; background: #e8f7e6; color: rgba(72, 125, 63, 0.995) !important; - font-family: $content-font; + font-family: $contents-font-stack; &:first-child::after { content: 'Tip'; diff --git a/assets/sass/components/_summary.scss b/assets/sass/components/_summary.scss index d1620a7..95aef6c 100644 --- a/assets/sass/components/_summary.scss +++ b/assets/sass/components/_summary.scss @@ -31,7 +31,7 @@ &__text { margin-top: 1rem; line-height: 1.7rem; - font-family: $content-font; + font-family: $contents-font-stack; } &__image { diff --git a/assets/sass/pages/_contact.scss b/assets/sass/pages/_contact.scss index 6bac3ba..2e9d0d9 100644 --- a/assets/sass/pages/_contact.scss +++ b/assets/sass/pages/_contact.scss @@ -68,7 +68,7 @@ &__desc { width: 65%; - font-family: $content-font; + font-family: $contents-font-stack; @media only screen and (max-width: 769px) { width: 100%; diff --git a/assets/sass/pages/_gallery.scss b/assets/sass/pages/_gallery.scss index d430bf8..1674dac 100644 --- a/assets/sass/pages/_gallery.scss +++ b/assets/sass/pages/_gallery.scss @@ -65,7 +65,7 @@ &__contents { padding: 1rem; width: 65%; - font-family: $content-font; + font-family: $contents-font-stack; font-size: 1rem; text-align: center; } diff --git a/assets/sass/pages/_list.scss b/assets/sass/pages/_list.scss index cde0a5b..0229a05 100644 --- a/assets/sass/pages/_list.scss +++ b/assets/sass/pages/_list.scss @@ -27,7 +27,7 @@ } &--desc { - font-family: $content-font; + font-family: $contents-font-stack; font-weight: italic; padding: 1rem; line-height: 1.7rem; diff --git a/assets/sass/pages/_showcase.scss b/assets/sass/pages/_showcase.scss index e82e8fd..e7cc14d 100644 --- a/assets/sass/pages/_showcase.scss +++ b/assets/sass/pages/_showcase.scss @@ -125,7 +125,7 @@ } &--desc { - font-family: $content-font; + font-family: $contents-font-stack; font-size: 0.9rem; margin: 0.25rem 0; height: 70px; diff --git a/assets/sass/pages/_single.scss b/assets/sass/pages/_single.scss index f7e0d6c..11bf693 100644 --- a/assets/sass/pages/_single.scss +++ b/assets/sass/pages/_single.scss @@ -10,6 +10,8 @@ font-family: $title-font; line-height: 3rem; overflow-wrap: break-word; + margin-top: 1.5rem; + margin-bottom: 0.5rem; @include animation('slide-in-down .2s .3s 1 ease-in both'); @include themify($themes) { @@ -19,6 +21,7 @@ &__meta { font-size: 0.8rem; + margin-bottom: 2rem; @include flexbox(); @include align-items(center); @@ -56,8 +59,8 @@ text-decoration: underline; } - font-size: 1rem; - font-family: $content-font; + font-size: 17.2px; + font-family: $contents-font-stack; margin: 1rem 0; line-height: 1.7; width: inheirt; diff --git a/layouts/partials/head/scripts.html b/layouts/partials/head/scripts.html index 44545ff..8e8aeaa 100644 --- a/layouts/partials/head/scripts.html +++ b/layouts/partials/head/scripts.html @@ -194,7 +194,17 @@ var navbar = document.querySelector('.navbar'); var tocFlexbox = document.querySelector('.toc__flexbox'); var tocFlexboxOuter = document.querySelector('.toc__flexbox--outer'); + var notAllowedTitleIds = null; + singleContentsElem && singleContentsElem.querySelectorAll(".tab") ? + singleContentsElem.querySelectorAll(".tab").forEach(function (elem) { + elem.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach(function (element) { + notAllowedTitleIds = Array.isArray(notAllowedTitleIds) ? + notAllowedTitleIds.concat(element.getAttribute('id')) : + [element.getAttribute('id')]; + }); + }) : null; + window.onscroll = function () { scrollFunction(); @@ -223,6 +233,10 @@ return null; } + if (notAllowedTitleIds && notAllowedTitleIds.includes(elem.getAttribute('id'))) { + return null; + } + if (document.documentElement.scrollTop >= elem.offsetTop) { if (tableOfContentsElem) { var id = elem.getAttribute('id'); @@ -282,6 +296,10 @@ if (toggleTocElem && !toggleTocElem.checked) { return null; } + + if (notAllowedTitleIds && notAllowedTitleIds.includes(elem.getAttribute('id'))) { + return null; + } if (document.documentElement.scrollTop >= elem.offsetTop) { if (tableOfContentsElem) { @@ -559,7 +577,7 @@ location: 0, distance: 100, maxPatternLength: 32, - minMatchCharLength: 1, + minMatchCharLength: 2, }); } else {