_sass/addon/commons.scss in jekyll-theme-chirpy-5.5.2 vs _sass/addon/commons.scss in jekyll-theme-chirpy-5.6.0

- old
+ new

@@ -3,38 +3,40 @@ */ html { @media (prefers-color-scheme: light) { &:not([data-mode]), - &[data-mode="light"] { + &[data-mode='light'] { @include light-scheme; } - &[data-mode="dark"] { + &[data-mode='dark'] { @include dark-scheme; } } @media (prefers-color-scheme: dark) { &:not([data-mode]), - &[data-mode="dark"] { + &[data-mode='dark'] { @include dark-scheme; } - &[data-mode="light"] { + &[data-mode='light'] { @include light-scheme; } } font-size: 16px; } body { - background: var(--body-bg); + background: var(--main-bg); + padding: env(safe-area-inset-top) env(safe-area-inset-right) + env(safe-area-inset-bottom) env(safe-area-inset-left); color: var(--text-color); -webkit-font-smoothing: antialiased; - font-family: "Source Sans Pro", "Microsoft Yahei", sans-serif; + font-family: 'Source Sans Pro', 'Microsoft Yahei', sans-serif; line-height: 1.75; } /* --- Typography --- */ @@ -88,19 +90,19 @@ &.lazyloaded { -webkit-animation: fade-in 0.4s ease-in; animation: fade-in 0.4s ease-in; } - &[data-lqip="true"] { + &[data-lqip='true'] { &.lazyload, &.lazyloading { -webkit-filter: blur(20px); filter: blur(20px); } } - &:not([data-lqip="true"]) { + &:not([data-lqip='true']) { &.lazyload, &.lazyloading { background: var(--img-bg); } } @@ -113,26 +115,34 @@ @extend %img-caption; } @-webkit-keyframes fade-in { - from { opacity: 0; } - to { opacity: 1; } + from { + opacity: 0; + } + to { + opacity: 1; + } } @keyframes fade-in { - from { opacity: 0; } - to { opacity: 1; } + from { + opacity: 0; + } + to { + opacity: 1; + } } } blockquote { border-left: 5px solid var(--blockquote-border-color); padding-left: 1rem; color: var(--blockquote-text-color); - &[class^="prompt-"] { + &[class^='prompt-'] { border-left: 0; position: relative; padding: 1rem 1rem 1rem 3rem; color: var(--prompt-text-color); @@ -151,21 +161,16 @@ > p:last-child { margin-bottom: 0; } } - @include prompt("tip", "\f0eb", "regular"); - @include prompt("info", "\f06a"); - @include prompt("warning", "\f06a"); - @include prompt("danger", "\f071"); + @include prompt('tip', '\f0eb', 'regular'); + @include prompt('info', '\f06a'); + @include prompt('warning', '\f06a'); + @include prompt('danger', '\f071'); } -mjx-container { - overflow-x: auto; - overflow-y: hidden; -} - kbd { font-family: inherit; display: inline-block; vertical-align: middle; line-height: 1.3rem; @@ -211,11 +216,12 @@ .footer-right { text-align: right; } } -i { /* fontawesome icons */ +/* fontawesome icons */ +i { &.far, &.fas { @extend %no-cursor; } } @@ -269,11 +275,11 @@ color: #ffffff; transition: none; } } - [data-topbar-visible="true"] & > div { + [data-topbar-visible='true'] & > div { top: 6rem; } } #access-lastmod { @@ -313,11 +319,11 @@ margin-bottom: 0; } /* [scroll-focus] added by `smooth-scroll.js` */ &:target:not([scroll-focus]), - &[scroll-focus="true"] > p { + &[scroll-focus='true'] > p { background-color: var(--footnote-target-bg); width: -moz-fit-content; width: -webkit-fit-content; width: fit-content; transition: background-color 1.5s ease-in-out; @@ -334,11 +340,11 @@ transition: background-color 1.5s ease-in-out; } /* [scroll-focus] added by `smooth-scroll.js` */ @at-root sup:target:not([scroll-focus]), - sup[scroll-focus=true] > a#{&} { + sup[scroll-focus='true'] > a#{&} { background-color: var(--footnote-target-bg); } } .reversefootnote { @@ -387,11 +393,11 @@ td { @extend %table-cell; } } } /* tbody */ - }/* table */ + } /* table */ } /* --- post --- */ .post { @@ -417,14 +423,10 @@ .post-meta { font-size: 0.85rem; word-spacing: 1px; a { - &:not(:last-child) { - margin-right: 2px; - } - &:not([class]):hover { @extend %link-hover; } } @@ -483,11 +485,12 @@ li { list-style-type: none; padding-left: 0; - > i { /* checkbox icon */ + /* checkbox icon */ + > i { width: 2rem; margin-left: -1.25rem; color: var(--checkbox-color); &.checked { @@ -499,11 +502,11 @@ -webkit-padding-start: 1.75rem; padding-inline-start: 1.75rem; } } - input[type="checkbox"] { + input[type='checkbox'] { margin: 0 0.5rem 0.2rem -1.3rem; vertical-align: middle; } } /* ul */ @@ -553,27 +556,39 @@ overflow: hidden; position: relative; background: var(--img-bg); &::before { - content: ""; + content: ''; position: absolute; background: var(--shimmer-bg); height: 100%; width: 100%; -webkit-animation: shimmer 1s infinite; animation: shimmer 1s infinite; } @-webkit-keyframes shimmer { - 0% { -webkit-transform: translateX(-100%); transform: translateX(-100%); } - 100% { -webkit-transform: translateX(100%); transform: translateX(100%); } + 0% { + -webkit-transform: translateX(-100%); + transform: translateX(-100%); + } + 100% { + -webkit-transform: translateX(100%); + transform: translateX(100%); + } } @keyframes shimmer { - 0% { -webkit-transform: translateX(-100%); transform: translateX(-100%); } - 100% { -webkit-transform: translateX(100%); transform: translateX(100%); } + 0% { + -webkit-transform: translateX(-100%); + transform: translateX(-100%); + } + 100% { + -webkit-transform: translateX(100%); + transform: translateX(100%); + } } } .embed-video { width: 100%; @@ -635,11 +650,12 @@ .no-text-decoration { @include no-text-decoration; } -.tooltip-inner { /* Overrided BS4 Tooltip */ +/* Overrided BS4 Tooltip */ +.tooltip-inner { font-size: 0.7rem; max-width: 220px; text-align: left; } @@ -682,13 +698,19 @@ /* mermaid */ .mermaid { text-align: center; } +/* MathJax */ +mjx-container { + overflow-y: hidden; + min-width: auto !important; +} + /* --- sidebar layout --- */ -$sidebar-display: "sidebar-display"; +$sidebar-display: 'sidebar-display'; #sidebar { @include pl-pr(0); position: fixed; @@ -704,12 +726,12 @@ &::-webkit-scrollbar { display: none; } /* Hide scrollbar for IE, Edge and Firefox */ - -ms-overflow-style: none; /* IE and Edge */ - scrollbar-width: none; /* Firefox */ + -ms-overflow-style: none; /* IE and Edge */ + scrollbar-width: none; /* Firefox */ a { @extend %sidebar-links; &:hover { @@ -770,10 +792,11 @@ word-spacing: 1px; margin: 0.2rem 1.5rem 0.5rem 1.5rem; min-height: 3rem; /* avoid vertical shifting in multi-line words */ -webkit-user-select: none; -moz-user-select: none; + -ms-user-select: none; user-select: none; } .nav-link { border-radius: 0; @@ -813,14 +836,15 @@ position: relative; left: calc($cursor-width / 2); width: 100%; } - &::after { /* the cursor */ + /* the cursor */ + &::after { display: table; visibility: hidden; - content: ""; + content: ''; position: relative; right: 1px; width: $cursor-width; height: $tab-cursor-height; border-radius: 1px; @@ -835,11 +859,12 @@ visibility: visible; } @for $i from 1 through $tab-count { $offset: $tab-count - $i; - $top: (-$offset * $tab-height) + (($tab-height - $tab-cursor-height) * 0.5); + $top: (-$offset * $tab-height) + + (($tab-height - $tab-cursor-height) * 0.5); @if $i < $tab-count { > li.active:nth-child(#{$i}), > li.nav-item:nth-child(#{$i}):hover { ~ li:last-child::after { @@ -896,11 +921,11 @@ .icon-border { @extend %no-cursor; background-color: var(--sidebar-muted-color); - content: ""; + content: ''; width: 3px; height: 3px; border-radius: 50%; } } /* .sidebar-bottom */ @@ -939,17 +964,18 @@ transition: top 0.2s ease-in-out; z-index: 50; border-bottom: 1px solid rgba(0, 0, 0, 0.07); background-color: var(--topbar-wrapper-bg); - [data-topbar-visible="false"] & { + [data-topbar-visible='false'] & { top: -$topbar-height; /* same as topbar height. */ } } #topbar { - i { /* icons */ + /* icons */ + i { color: #999999; } #breadcrumb { font-size: 1rem; @@ -961,11 +987,11 @@ } span { &:not(:last-child) { &::after { - content: "›"; + content: '›'; padding: 0 0.3rem; } } } } @@ -989,11 +1015,12 @@ font-size: 0.9rem; color: var(--search-icon-color); } } -#search-cancel { /* 'Cancel' link */ +/* 'Cancel' link */ +#search-cancel { color: var(--link-color); margin-left: 1rem; display: none; @extend %cursor-pointer; @@ -1010,13 +1037,25 @@ &:focus { box-shadow: none; background: center; &.form-control { - &::-moz-placeholder { @include input-placeholder; } - &::-webkit-input-placeholder { @include input-placeholder; } - &::placeholder { @include input-placeholder; } + &::-moz-placeholder { + @include input-placeholder; + } + &::-webkit-input-placeholder { + @include input-placeholder; + } + &:-ms-input-placeholder { + @include input-placeholder; + } + &::-ms-input-placeholder { + @include input-placeholder; + } + &::placeholder { + @include input-placeholder; + } } } } #search-hints { @@ -1034,11 +1073,11 @@ border: none; padding: 0.5rem; margin: 0 1.25rem 1rem 0; &::before { - content: "#"; + content: '#'; color: var(--text-muted-color); padding-right: 0.2rem; } @extend %link-color; @@ -1066,11 +1105,12 @@ &:not(:last-child) { margin-bottom: 1rem; } - i { /* icons */ + /* icons */ + i { color: #818182; margin-right: 0.15rem; font-size: 80%; } @@ -1113,14 +1153,11 @@ } #mask { display: none; position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; + inset: 0 0 0 0; height: 100%; width: 100%; z-index: 1; @at-root [#{$sidebar-display}] & { @@ -1264,19 +1301,21 @@ #main-wrapper { min-height: calc(100vh - #{$footer-height-mobile}); } #core-wrapper { - min-height: calc(100vh - #{$topbar-height} - #{$footer-height-mobile}) !important; + min-height: calc( + 100vh - #{$topbar-height} - #{$footer-height-mobile} + ) !important; h1 { margin-top: 2.2rem; font-size: 1.75rem; } .post-content { - > blockquote[class^="prompt-"] { + > blockquote[class^='prompt-'] { @include ml-mr(-1.25rem); border-radius: 0; max-width: none; } @@ -1408,11 +1447,11 @@ } } } /* max-width: 849px */ @media all and (max-width: 849px) and (orientation: portrait) { - [data-topbar-visible="false"] #topbar-wrapper { + [data-topbar-visible='false'] #topbar-wrapper { top: 0; } } /* Phone & Pad */ @@ -1598,11 +1637,13 @@ #topbar-wrapper { left: $sidebar-width-large; } #search-wrapper { - margin-right: calc(#{$main-content-max-width} * 0.25 - #{$search-max-width}); + margin-right: calc( + #{$main-content-max-width} * 0.25 - #{$search-max-width} + ); } #topbar, #main, footer > .container { @@ -1613,10 +1654,12 @@ #tail-wrapper { padding-right: 4.5rem !important; } #back-to-top { - right: calc((100vw - #{$sidebar-width-large} - #{$main-content-max-width}) / 2 + 2rem); + right: calc( + (100vw - #{$sidebar-width-large} - #{$main-content-max-width}) / 2 + 2rem + ); } #sidebar { width: $sidebar-width-large;