mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-18 21:53:26 +00:00
Improve SASS code style.
This commit is contained in:
@@ -5,4 +5,4 @@
|
||||
*
|
||||
*/
|
||||
|
||||
@import url('https://fonts.googleapis.com/css?family=Lato|Roboto+Condensed:400,700|Source+Sans+Pro:400,600,700,900&display=swap');
|
||||
@import url('https://fonts.googleapis.com/css?family=Lato|Roboto+Condensed:400,700|Source+Sans+Pro:400,600,700,900&display=swap');
|
||||
|
||||
@@ -106,7 +106,7 @@ $sidebar-display: "sidebar-display";
|
||||
}
|
||||
|
||||
.sidebar-bottom {
|
||||
.icon-border+a { // the icon behide mode-toggle
|
||||
.icon-border + a { // the icon behide mode-toggle
|
||||
margin-left: .1rem;
|
||||
}
|
||||
}
|
||||
@@ -185,7 +185,7 @@ $sidebar-display: "sidebar-display";
|
||||
margin-bottom: .5rem; // icons may have multi lines
|
||||
}
|
||||
|
||||
a:hover, #mode-toggle-wrapper>i:hover {
|
||||
a:hover, #mode-toggle-wrapper > i:hover {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ $sidebar-display: "sidebar-display";
|
||||
} // #sidebar
|
||||
|
||||
@media (hover: hover) {
|
||||
#sidebar ul>li:last-child::after {
|
||||
#sidebar ul > li:last-child::after {
|
||||
-webkit-transition: top .5s ease;
|
||||
-moz-transition: top .5s ease;
|
||||
-o-transition: top .5s ease;
|
||||
@@ -242,7 +242,7 @@ $sidebar-display: "sidebar-display";
|
||||
transition: border-color 0.35s ease-in-out;
|
||||
}
|
||||
|
||||
&:hover>a {
|
||||
&:hover > a {
|
||||
border-color: #fff;
|
||||
}
|
||||
|
||||
@@ -448,7 +448,7 @@ $sidebar-display: "sidebar-display";
|
||||
@include pl-pr(0);
|
||||
}
|
||||
|
||||
#main>div.row:first-child>div {
|
||||
#main > div.row:first-child > div {
|
||||
&:nth-child(1), &:nth-child(2) {
|
||||
margin-top: $topbar-height; /* same as the height of topbar */
|
||||
}
|
||||
@@ -544,7 +544,7 @@ footer {
|
||||
|
||||
|
||||
#access-tags {
|
||||
>div.post-content>div {
|
||||
>div.post-content > div {
|
||||
max-width: 80%;
|
||||
}
|
||||
.post-tag {
|
||||
@@ -676,7 +676,7 @@ sup {
|
||||
&:not(:last-child) {
|
||||
margin-bottom: -.8rem;
|
||||
}
|
||||
&:target>p {
|
||||
&:target > p {
|
||||
background-color: var(--footnote-target-bg);
|
||||
width: fit-content;
|
||||
-webkit-transition: background-color 1.5s ease-in-out;
|
||||
@@ -693,7 +693,7 @@ sup {
|
||||
-webkit-transition: background-color 1.5s ease-in-out; /* Safari prior 6.1 */
|
||||
transition: background-color 1.5s ease-in-out;
|
||||
}
|
||||
@at-root sup:target>a#{&} {
|
||||
@at-root sup:target > a#{&} {
|
||||
background-color: var(--footnote-target-bg);
|
||||
padding: 0 2px;
|
||||
}
|
||||
@@ -928,7 +928,7 @@ div.post-content .table-wrapper {
|
||||
|
||||
$footer-height: 6rem; // overwrite
|
||||
|
||||
#main>div.row:first-child>div:first-child {
|
||||
#main > div.row:first-child > div:first-child {
|
||||
min-height: calc(100vh - #{$topbar-height} - #{$footer-height});
|
||||
}
|
||||
|
||||
@@ -941,7 +941,7 @@ div.post-content .table-wrapper {
|
||||
}
|
||||
}
|
||||
|
||||
#avatar>a {
|
||||
#avatar > a {
|
||||
width: 5rem;
|
||||
height: 5rem;
|
||||
}
|
||||
@@ -951,7 +951,7 @@ div.post-content .table-wrapper {
|
||||
}
|
||||
|
||||
/* table text in small screens */
|
||||
div>table, p~table {
|
||||
div > table, p ~ table {
|
||||
width: 100%;
|
||||
table-layout: fixed;
|
||||
word-wrap: break-word;
|
||||
@@ -1051,8 +1051,8 @@ div.post-content .table-wrapper {
|
||||
top: 0 !important;
|
||||
}
|
||||
|
||||
#main>div.row:first-child>div:nth-child(1),
|
||||
#main>div.row:first-child>div:nth-child(2) {
|
||||
#main > div.row:first-child > div:nth-child(1),
|
||||
#main > div.row:first-child > div:nth-child(2) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
@@ -1063,7 +1063,7 @@ div.post-content .table-wrapper {
|
||||
}
|
||||
|
||||
#search-wrapper {
|
||||
&.loaded~a {
|
||||
&.loaded ~ a {
|
||||
margin-right: 1rem;
|
||||
}
|
||||
.fa-times-circle {
|
||||
@@ -1095,7 +1095,7 @@ div.post-content .table-wrapper {
|
||||
padding-top: 3.4rem;
|
||||
}
|
||||
|
||||
.footnotes ol>li {
|
||||
.footnotes ol > li {
|
||||
padding-top: 3.5rem;
|
||||
margin-top: -4.3rem;
|
||||
&:first-child {
|
||||
@@ -1106,7 +1106,7 @@ div.post-content .table-wrapper {
|
||||
|
||||
|
||||
@media all and (min-width: 577px) and (max-width: 1199px) {
|
||||
footer>.d-flex>div {
|
||||
footer>.d-flex > div {
|
||||
width: 312px;
|
||||
}
|
||||
}
|
||||
@@ -1147,7 +1147,7 @@ div.post-content .table-wrapper {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
footer>div.d-flex {
|
||||
footer > div.d-flex {
|
||||
width: 92%;
|
||||
}
|
||||
|
||||
@@ -1184,7 +1184,7 @@ div.post-content .table-wrapper {
|
||||
width: calc(100% - 210px);
|
||||
}
|
||||
|
||||
#search-results>div {
|
||||
#search-results > div {
|
||||
max-width: 700px;
|
||||
}
|
||||
|
||||
@@ -1222,7 +1222,7 @@ div.post-content .table-wrapper {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#main>div.row {
|
||||
#main > div.row {
|
||||
-webkit-box-pack: center!important;
|
||||
-ms-flex-pack: center!important;
|
||||
justify-content: center!important;
|
||||
@@ -1234,7 +1234,7 @@ div.post-content .table-wrapper {
|
||||
|
||||
@media all and (min-width: 1200px) {
|
||||
|
||||
#main>div.row>div.col-xl-8 {
|
||||
#main > div.row > div.col-xl-8 {
|
||||
-webkit-box-flex: 0;
|
||||
-ms-flex: 0 0 75%;
|
||||
flex: 0 0 75%;
|
||||
@@ -1265,7 +1265,7 @@ div.post-content .table-wrapper {
|
||||
width: calc(100% - 260px);
|
||||
}
|
||||
|
||||
#search-results>div {
|
||||
#search-results > div {
|
||||
max-width: 46%;
|
||||
&:nth-child(odd) {
|
||||
margin-right: 1.5rem;
|
||||
@@ -1283,7 +1283,7 @@ div.post-content .table-wrapper {
|
||||
font-size: 1.03rem;
|
||||
}
|
||||
|
||||
footer>div.d-felx {
|
||||
footer > div.d-felx {
|
||||
width: 85%;
|
||||
}
|
||||
|
||||
@@ -1291,7 +1291,7 @@ div.post-content .table-wrapper {
|
||||
|
||||
@media all and (min-width: 1400px) {
|
||||
|
||||
#main>div.row {
|
||||
#main > div.row {
|
||||
padding-left: calc((100% - #{$main-content-max-width}) / 2);
|
||||
>div.col-xl-8 {
|
||||
max-width: 850px;
|
||||
@@ -1323,7 +1323,7 @@ div.post-content .table-wrapper {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
#main>div.row>div.col-xl-8 {
|
||||
#main > div.row > div.col-xl-8 {
|
||||
padding-left: 0;
|
||||
>div:first-child {
|
||||
padding-left: .55rem !important;
|
||||
@@ -1400,7 +1400,7 @@ div.post-content .table-wrapper {
|
||||
|
||||
ul {
|
||||
margin-left: 3%;
|
||||
>li>a {
|
||||
>li > a {
|
||||
padding-left: 2.5rem;
|
||||
-webkit-box-pack: start!important;
|
||||
-ms-flex-pack: start!important;
|
||||
@@ -1457,7 +1457,7 @@ div.post-content .table-wrapper {
|
||||
}
|
||||
} // .sidebar-bottom
|
||||
} // #sidebar
|
||||
footer>div.d-flex {
|
||||
footer > div.d-flex {
|
||||
width: 87%;
|
||||
max-width: 1140px;
|
||||
}
|
||||
@@ -1482,7 +1482,7 @@ div.post-content .table-wrapper {
|
||||
max-width: calc(#{$main-content-max-width} + 20px)
|
||||
}
|
||||
|
||||
#main>div.row {
|
||||
#main > div.row {
|
||||
padding-left: calc((100% - #{$main-content-max-width} - 2%) / 2);
|
||||
}
|
||||
|
||||
@@ -1502,7 +1502,7 @@ div.post-content .table-wrapper {
|
||||
}
|
||||
|
||||
@media (min-width: 1920px) {
|
||||
#main>div.row {
|
||||
#main > div.row {
|
||||
padding-left: 190px;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/*---------- scss placeholder ---------*/
|
||||
/* ---------- scss placeholder --------- */
|
||||
|
||||
%tag-hover {
|
||||
background: var(--tag-hover);
|
||||
@@ -15,12 +15,12 @@
|
||||
}
|
||||
|
||||
%table-cell {
|
||||
padding: .4rem 1rem;
|
||||
padding: 0.4rem 1rem;
|
||||
font-size: 95%;
|
||||
}
|
||||
|
||||
%link-hover {
|
||||
color: #d2603a!important;
|
||||
color: #d2603a !important;
|
||||
border-bottom: 1px solid #d2603a;
|
||||
text-decoration: none;
|
||||
}
|
||||
@@ -54,7 +54,7 @@
|
||||
margin-top: -2.5rem;
|
||||
}
|
||||
|
||||
/*---------- scss mixin ---------*/
|
||||
/* ---------- scss mixin --------- */
|
||||
|
||||
@mixin no-text-decoration {
|
||||
text-decoration: none;
|
||||
@@ -64,7 +64,7 @@
|
||||
color: $color;
|
||||
transition: color 0.35s ease-in-out;
|
||||
user-select: none;
|
||||
margin: 0 .25rem;
|
||||
margin: 0 0.25rem;
|
||||
}
|
||||
|
||||
@mixin icon-round($diameter) {
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
@import "_colors/light-syntax";
|
||||
@import "_colors/dark-syntax";
|
||||
|
||||
|
||||
html:not([mode]), html[mode=light] {
|
||||
html:not([mode]),
|
||||
html[mode=light] {
|
||||
@include light-syntax;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,8 @@ html[mode=dark] {
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
html:not([mode]), html[mode=dark] {
|
||||
html:not([mode]),
|
||||
html[mode=dark] {
|
||||
@include dark-syntax;
|
||||
}
|
||||
|
||||
@@ -28,7 +29,7 @@ html[mode=dark] {
|
||||
}
|
||||
}
|
||||
|
||||
/*-- Codes Snippet --*/
|
||||
/* -- Codes Snippet -- */
|
||||
|
||||
%code-snippet-bg {
|
||||
background: var(--highlight-bg-color);
|
||||
@@ -39,12 +40,19 @@ html[mode=dark] {
|
||||
}
|
||||
|
||||
%code-snippet-padding {
|
||||
padding: .8rem 1rem;
|
||||
padding: 0.8rem 1rem;
|
||||
}
|
||||
|
||||
div > pre {
|
||||
@extend %code-snippet-bg;
|
||||
@extend %code-snippet-radius;
|
||||
@extend %code-snippet-padding;
|
||||
}
|
||||
|
||||
.highlighter-rouge {
|
||||
@extend %code-snippet-bg;
|
||||
@extend %code-snippet-radius;
|
||||
|
||||
color: var(--highlighter-rouge-color);
|
||||
margin-bottom: 1.2em; /* Override BS Inline-code style */
|
||||
}
|
||||
@@ -52,13 +60,15 @@ html[mode=dark] {
|
||||
.highlight {
|
||||
@extend %code-snippet-radius;
|
||||
@extend %code-snippet-bg;
|
||||
|
||||
@at-root figure#{&} {
|
||||
@extend %code-snippet-bg;
|
||||
}
|
||||
|
||||
overflow: auto;
|
||||
.lineno {
|
||||
margin: .8rem 0rem;
|
||||
padding: 0 .5rem;
|
||||
margin: 0.8rem 0;
|
||||
padding: 0 0.5rem;
|
||||
min-width: 2.2rem;
|
||||
text-align: right;
|
||||
color: var(--highlight-lineno-color);
|
||||
@@ -70,6 +80,12 @@ html[mode=dark] {
|
||||
-o-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
pre {
|
||||
margin-bottom: 0;
|
||||
font-size: 0.85rem;
|
||||
line-height: 1.4rem;
|
||||
word-wrap: normal; /* Fixed Safari overflow-x */
|
||||
}
|
||||
table {
|
||||
padding: 0;
|
||||
border: 0;
|
||||
@@ -82,14 +98,6 @@ html[mode=dark] {
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
pre {
|
||||
margin-bottom: 0;
|
||||
font-size: .85rem;
|
||||
line-height: 1.4rem;
|
||||
word-wrap: normal;
|
||||
/* Fixed Safari overflow-x */
|
||||
}
|
||||
|
||||
} //.highlight
|
||||
|
||||
code {
|
||||
@@ -97,19 +105,23 @@ code {
|
||||
-ms-hyphens: none;
|
||||
-moz-hyphens: none;
|
||||
hyphens: none;
|
||||
|
||||
&.highlighter-rouge {
|
||||
padding: 3px 5px;
|
||||
margin: 0 .15rem;
|
||||
margin: 0 0.15rem;
|
||||
border-radius: 4px;
|
||||
background-color: var(--inline-code-bg);
|
||||
}
|
||||
@at-root a>&.highlighter-rouge {
|
||||
|
||||
@at-root a > &.highlighter-rouge {
|
||||
padding-bottom: 0; // show link's underlinke
|
||||
color: inherit;
|
||||
}
|
||||
@at-root a:hover>&.highlighter-rouge {
|
||||
|
||||
@at-root a:hover > &.highlighter-rouge {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
blockquote &.highlighter-rouge {
|
||||
color: inherit;
|
||||
}
|
||||
@@ -120,12 +132,6 @@ td.rouge-code {
|
||||
padding-right: 1rem;
|
||||
}
|
||||
|
||||
div>pre {
|
||||
@extend %code-snippet-bg;
|
||||
@extend %code-snippet-radius;
|
||||
@extend %code-snippet-padding;
|
||||
}
|
||||
|
||||
/* Hide line numbers for default, console, and terminal code snippets */
|
||||
div {
|
||||
&[class^='highlighter-rouge'],
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/*--- ↓ width and height ----*/
|
||||
/* --- ↓ width and height ---- */
|
||||
|
||||
$tab-height: 3.3rem;
|
||||
$tab-cursor-height: 1.6rem;
|
||||
|
||||
Reference in New Issue
Block a user