Improve the SCSS code style

This commit is contained in:
Cotes Chung 2020-10-27 22:08:04 +08:00
parent 7d128769f6
commit 62aef9f850
8 changed files with 112 additions and 112 deletions

View file

@ -87,7 +87,7 @@ $sidebar-display: "sidebar-display";
a { a {
font-weight: 900; font-weight: 900;
font-size: 1.5rem; font-size: 1.5rem;
letter-spacing: .5px; letter-spacing: 0.5px;
&:hover { &:hover {
color: #fff; color: #fff;
text-decoration: none; text-decoration: none;
@ -101,17 +101,17 @@ $sidebar-display: "sidebar-display";
color: #828282; color: #828282;
line-height: 1.2rem; line-height: 1.2rem;
word-spacing: 1px; word-spacing: 1px;
margin: .5rem 1.5rem 2rem 1.5rem; margin: 0.5rem 1.5rem 2rem 1.5rem;
} }
.sidebar-bottom { .sidebar-bottom {
.icon-border + a { // the icon behide mode-toggle .icon-border + a { // the icon behide mode-toggle
margin-left: .1rem; margin-left: 0.1rem;
} }
} }
.nav-link { .nav-link {
border-radius: 0; border-radius: 0;
font-size: .95rem; font-size: 0.95rem;
font-weight: 600; font-weight: 600;
letter-spacing: 1px; letter-spacing: 1px;
} }
@ -133,8 +133,8 @@ $sidebar-display: "sidebar-display";
display: -webkit-box; display: -webkit-box;
display: -ms-flexbox; display: -ms-flexbox;
>li:last-child { > li:last-child {
>a { > a {
margin-right: -3px; margin-right: -3px;
max-width: calc(100% - 3px); max-width: calc(100% - 3px);
} }
@ -160,15 +160,15 @@ $sidebar-display: "sidebar-display";
$top: -$offset * $tab-height + $tab-cursor-height / 2; $top: -$offset * $tab-height + $tab-cursor-height / 2;
@if $i < $tab-count { @if $i < $tab-count {
>li.active:nth-child(#{$i}), > li.active:nth-child(#{$i}),
>li.nav-item:nth-child(#{$i}):hover { > li.nav-item:nth-child(#{$i}):hover {
~li:last-child::after { ~li:last-child::after {
@include fix-cursor($top); @include fix-cursor($top);
} }
} }
} @else { } @else {
>li.active:nth-child(#{$i}):last-child::after, > li.active:nth-child(#{$i}):last-child::after,
>li.nav-item:nth-child(#{$i}):last-child:hover::after { > li.nav-item:nth-child(#{$i}):last-child:hover::after {
@include fix-cursor($top); @include fix-cursor($top);
} }
} }
@ -181,7 +181,7 @@ $sidebar-display: "sidebar-display";
font-size: 1.2rem; font-size: 1.2rem;
margin: 2rem 2.5rem 1.6rem; margin: 2rem 2.5rem 1.6rem;
a { a {
margin-bottom: .5rem; // icons may have multi lines margin-bottom: 0.5rem; // icons may have multi lines
} }
a:hover, #mode-toggle-wrapper > i:hover { a:hover, #mode-toggle-wrapper > i:hover {
@ -204,7 +204,7 @@ $sidebar-display: "sidebar-display";
width: 3px; width: 3px;
height: 3px; height: 3px;
border-radius: 50%; border-radius: 50%;
margin-top: .75rem; margin-top: 0.75rem;
} }
} }
} // #sidebar } // #sidebar
@ -228,7 +228,7 @@ $sidebar-display: "sidebar-display";
} }
#avatar { #avatar {
>a { > a {
display: block; display: block;
width: 6rem; width: 6rem;
height: 6rem; height: 6rem;
@ -295,7 +295,7 @@ $sidebar-display: "sidebar-display";
#breadcrumb { #breadcrumb {
font-size: 1rem; font-size: 1rem;
color: gray; color: gray;
padding-left: .5rem; padding-left: 0.5rem;
a:hover { a:hover {
@extend %link-hover; @extend %link-hover;
} }
@ -323,7 +323,7 @@ $sidebar-display: "sidebar-display";
padding: 0 .5rem; padding: 0 .5rem;
i { i {
z-index: 2; z-index: 2;
font-size: .9rem; font-size: 0.9rem;
color: var(--search-icon-color); color: var(--search-icon-color);
} }
.fa-times-circle { /* button 'clean up' */ .fa-times-circle { /* button 'clean up' */
@ -341,7 +341,7 @@ $sidebar-display: "sidebar-display";
background: center; background: center;
border: 0; border: 0;
border-radius: 0; border-radius: 0;
padding: .18rem .3rem; padding: 0.18rem .3rem;
color: var(--text-color); color: var(--text-color);
} }
@ -366,12 +366,12 @@ $sidebar-display: "sidebar-display";
font-size: 1rem; font-size: 1rem;
background: var(--search-tag-bg); background: var(--search-tag-bg);
border: none; border: none;
padding: .5rem; padding: 0.5rem;
margin: 0 1rem 1rem 0; margin: 0 1rem 1rem 0;
&::before { &::before {
content: "#"; content: "#";
color: var(--text-muted-color); color: var(--text-muted-color);
padding-right: .2rem; padding-right: 0.2rem;
} }
} }
} }
@ -388,17 +388,17 @@ $sidebar-display: "sidebar-display";
@extend %link-hover; @extend %link-hover;
} }
} }
>div { > div {
max-width: 100%; max-width: 100%;
&:not(:last-child) { &:not(:last-child) {
margin-bottom: 1rem; margin-bottom: 1rem;
} }
i { // icons i { // icons
color: #818182; color: #818182;
margin-right: .15rem; margin-right: 0.15rem;
font-size: 80%; font-size: 80%;
} }
>p { > p {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
@ -476,13 +476,13 @@ footer {
font-size: 0.8rem; font-size: 0.8rem;
color: #7a7b7d; color: #7a7b7d;
background-color: var(--footer-bg-color); background-color: var(--footer-bg-color);
>div.d-flex { > div.d-flex {
line-height: 1.2rem; line-height: 1.2rem;
width: 95%; width: 95%;
max-width: 1045px; max-width: 1045px;
border-top: 1px solid var(--main-border-color); border-top: 1px solid var(--main-border-color);
margin-bottom: 1rem; margin-bottom: 1rem;
>div { > div {
width: 350px; width: 350px;
} }
} }
@ -527,13 +527,13 @@ footer {
@include panel-label; @include panel-label;
} }
.post-content { .post-content {
font-size: .9rem; font-size: 0.9rem;
} }
} }
#access-tags { #access-tags {
>div.post-content > div { > div.post-content > div {
max-width: 80%; max-width: 80%;
} }
.post-tag { .post-tag {
@ -542,8 +542,8 @@ footer {
font-size: 0.85rem; font-size: 0.85rem;
background: none; background: none;
border: 1px solid var(--btn-border-color); border: 1px solid var(--btn-border-color);
border-radius: .8rem; border-radius: 0.8rem;
padding: .3rem .5rem; padding: 0.3rem .5rem;
margin: 0 .35rem .5rem 0; margin: 0 .35rem .5rem 0;
&:hover { &:hover {
background-color: #2a408e; background-color: #2a408e;
@ -556,7 +556,7 @@ footer {
#access-lastmod { #access-lastmod {
ul { ul {
>li { > li {
height: 1.8rem; height: 1.8rem;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
@ -659,12 +659,12 @@ sup {
} }
.footnotes ol { .footnotes ol {
margin-top: .5rem; margin-top: 0.5rem;
>li { > li {
padding-top: .2rem; padding-top: 0.2rem;
margin-top: -0.2rem; margin-top: -0.2rem;
>p { > p {
padding-left: .2em; padding-left: 0.2em;
} }
&:not(:last-child) { &:not(:last-child) {
margin-bottom: -.8rem; margin-bottom: -.8rem;
@ -694,11 +694,11 @@ sup {
.reversefootnote { .reversefootnote {
@at-root a#{&} { @at-root a#{&} {
font-size: .6rem; font-size: 0.6rem;
position: absolute; position: absolute;
line-height: 1; line-height: 1;
padding-top: .5em; padding-top: 0.5em;
margin-left: .5em; margin-left: 0.5em;
border-bottom-style: none !important; border-bottom-style: none !important;
} }
} }
@ -737,7 +737,7 @@ img {
margin-bottom: 1rem; margin-bottom: 1rem;
} }
em { /* MarkDown italic */ em { /* MarkDown italic */
padding-right: .2rem; padding-right: 0.2rem;
} }
a:hover { a:hover {
code { code {
@ -751,7 +751,7 @@ img {
div.post-content .table-wrapper { div.post-content .table-wrapper {
overflow-x: auto; overflow-x: auto;
>table { > table {
min-width: 60%; min-width: 60%;
overflow-x: auto; overflow-x: auto;
border-spacing: 0; border-spacing: 0;
@ -812,8 +812,8 @@ div.post-content .table-wrapper {
word-wrap: break-word; word-wrap: break-word;
@mixin img($caption: false) { @mixin img($caption: false) {
>img:not([style]) { > img:not([style]) {
margin: .5rem 0; margin: 0.5rem 0;
&:not(.normal):not(.left):not(.right) { &:not(.normal):not(.left):not(.right) {
@include align-center; @include align-center;
@ -825,12 +825,12 @@ div.post-content .table-wrapper {
&.left { &.left {
float: left; float: left;
margin: .75rem 1rem 1rem 0; margin: 0.75rem 1rem 1rem 0;
} }
&.right { &.right {
float: right; float: right;
margin: .75rem 0 1rem 1rem; margin: 0.75rem 0 1rem 1rem;
} }
} }
@ -876,12 +876,12 @@ div.post-content .table-wrapper {
min-width: 2rem; min-width: 2rem;
text-align: center; text-align: center;
background: var(--tag-bg); background: var(--tag-bg);
border-radius: .3rem; border-radius: 0.3rem;
padding: 0 .4rem; padding: 0 .4rem;
color: inherit; color: inherit;
line-height: 1.3rem; line-height: 1.3rem;
&:not(:last-child) { &:not(:last-child) {
margin-right: .2rem; margin-right: 0.2rem;
} }
&:hover { &:hover {
@ -942,7 +942,7 @@ div.post-content .table-wrapper {
} }
.tooltip-inner { /* Overrided BS4 Tooltip */ .tooltip-inner { /* Overrided BS4 Tooltip */
font-size: .7rem; font-size: 0.7rem;
max-width: 220px; max-width: 220px;
text-align: left; text-align: left;
} }
@ -1005,10 +1005,10 @@ div.post-content .table-wrapper {
footer { footer {
height: $footer-height; height: $footer-height;
>div.d-flex { > div.d-flex {
width: 100%; width: 100%;
padding: 1.5rem 0; padding: 1.5rem 0;
margin-bottom: .3rem; margin-bottom: 0.3rem;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: left!important; justify-content: left!important;
-ms-flex-pack: distribute!important; -ms-flex-pack: distribute!important;
@ -1335,14 +1335,14 @@ div.post-content .table-wrapper {
#main > div.row { #main > div.row {
padding-left: calc((100% - #{$main-content-max-width}) / 2); padding-left: calc((100% - #{$main-content-max-width}) / 2);
>div.col-xl-8 { > div.col-xl-8 {
max-width: 850px; max-width: 850px;
} }
} }
#search-result-wrapper { #search-result-wrapper {
padding-right: 2rem; padding-right: 2rem;
>div { > div {
max-width: 1110px; max-width: 1110px;
} }
} }
@ -1367,8 +1367,8 @@ div.post-content .table-wrapper {
#main > div.row > div.col-xl-8 { #main > div.row > div.col-xl-8 {
padding-left: 0; padding-left: 0;
>div:first-child { > div:first-child {
padding-left: .55rem !important; padding-left: 0.55rem !important;
padding-right: 1.9rem !important; padding-right: 1.9rem !important;
} }
} }
@ -1401,14 +1401,14 @@ div.post-content .table-wrapper {
-webkit-box-pack: normal !important; -webkit-box-pack: normal !important;
-ms-flex-pack: normal !important; -ms-flex-pack: normal !important;
justify-content: normal !important; justify-content: normal !important;
>a { > a {
width: 6.2rem; width: 6.2rem;
height: 6.2rem; height: 6.2rem;
} }
} }
.profile-text { .profile-text {
margin-left: .5rem; margin-left: 0.5rem;
/* .d-flex */ /* .d-flex */
display: -webkit-box!important; display: -webkit-box!important;
display: -ms-flexbox!important; display: -ms-flexbox!important;
@ -1419,7 +1419,7 @@ div.post-content .table-wrapper {
/* .align-content-center */ /* .align-content-center */
-ms-flex-line-pack: center!important; -ms-flex-line-pack: center!important;
align-content: center!important; align-content: center!important;
>div { > div {
text-align: left !important; text-align: left !important;
width: 100%; width: 100%;
} }
@ -1437,12 +1437,12 @@ div.post-content .table-wrapper {
.site-subtitle { .site-subtitle {
word-spacing: 0; word-spacing: 0;
margin: .3rem 0 0 0; margin: 0.3rem 0 0 0;
} }
ul { ul {
margin-left: 3%; margin-left: 3%;
>li > a { > li > a {
padding-left: 2.5rem; padding-left: 2.5rem;
-webkit-box-pack: start!important; -webkit-box-pack: start!important;
-ms-flex-pack: start!important; -ms-flex-pack: start!important;
@ -1451,14 +1451,14 @@ div.post-content .table-wrapper {
} }
.nav-link { .nav-link {
>span { > span {
letter-spacing: 3px; letter-spacing: 3px;
} }
>i { > i {
@include icon-round(1.65rem); @include icon-round(1.65rem);
line-height: 1rem; line-height: 1rem;
font-size: .6rem; font-size: 0.6rem;
padding: .5em 0 0 .1em; padding: 0.5em 0 0 .1em;
display: inline-block!important; display: inline-block!important;
} }
} }
@ -1477,22 +1477,22 @@ div.post-content .table-wrapper {
i { i {
text-align: center; text-align: center;
width: 1.25em; width: 1.25em;
padding-top: .44rem; padding-top: 0.44rem;
} }
} }
#mode-toggle-wrapper { #mode-toggle-wrapper {
font-size: .9rem; font-size: 0.9rem;
i { i {
@include icon-round(2rem); @include icon-round(2rem);
padding-top: .44rem; padding-top: 0.44rem;
bottom: 0; bottom: 0;
} }
} }
.icon-border { .icon-border {
@include ml-mr(.2rem); @include ml-mr(.2rem);
margin-top: .85rem; margin-top: 0.85rem;
+a { +a {
margin-left: 0; margin-left: 0;
} }
@ -1506,7 +1506,7 @@ div.post-content .table-wrapper {
#search-result-wrapper { #search-result-wrapper {
width: calc(100% - #{$sidebar-width-large}); width: calc(100% - #{$sidebar-width-large});
>div { > div {
max-width: #{$main-content-max-width}; max-width: #{$main-content-max-width};
} }
} }

View file

@ -100,14 +100,14 @@
} }
@mixin panel-label { @mixin panel-label {
@include label(inherit);
display: block; display: block;
line-height: 1.2; line-height: 1.2;
padding-top: .5rem; padding-top: 0.5rem;
padding-bottom: .5rem; padding-bottom: 0.5rem;
margin-top: 0; margin-top: 0;
margin-bottom: 0; margin-bottom: 0;
letter-spacing: -0.02em; letter-spacing: -0.02em;
@include label(inherit);
} }
@mixin align-center { @mixin align-center {

View file

@ -33,7 +33,7 @@
background-image: linear-gradient( background-image: linear-gradient(
to left, #fff, #fbfbfb, #fbfbfb, #fbfbfb, #fff); to left, #fff, #fbfbfb, #fbfbfb, #fbfbfb, #fff);
} }
>div { > div {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
@ -111,12 +111,12 @@
} // #archives .date } // #archives .date
ul { ul {
>li { > li {
>div>a { > div > a {
/* post title in Archvies */ /* post title in Archvies */
margin-left: 2.5rem; margin-left: 2.5rem;
position: relative; position: relative;
top: .1rem; top: 0.1rem;
} }
&::after { &::after {
@extend %date-timeline; @extend %date-timeline;
@ -129,10 +129,10 @@
top: -1.61rem; top: -1.61rem;
} }
} }
&:not(:last-child)>li:last-child::after { &:not(:last-child) > li:last-child::after {
height: 3.4rem; height: 3.4rem;
} }
&:last-child>li:last-child::after { &:last-child > li:last-child::after {
display: none; display: none;
} }
} // #archives ul } // #archives ul

View file

@ -22,7 +22,7 @@
border-left: none; border-left: none;
border-right: none; border-right: none;
padding-left: 2rem; padding-left: 2rem;
>i { > i {
@extend %category-icon-color; @extend %category-icon-color;
} }
&:first-child { &:first-child {
@ -32,7 +32,7 @@
} }
.card-header>span>i:first-child { .card-header > span > i:first-child {
@extend %category-icon-color; @extend %category-icon-color;
} }
@ -50,9 +50,9 @@
border-radius: 50%; border-radius: 50%;
text-align: center; text-align: center;
color: #6c757d!important; color: #6c757d!important;
>i.fas { > i.fas {
position: relative; position: relative;
height: .7rem; height: 0.7rem;
width: 1rem; width: 1rem;
transition: 300ms ease all; transition: 300ms ease all;
} }

View file

@ -10,9 +10,9 @@
{% include_relative _addon/main.scss %} {% include_relative _addon/main.scss %}
#page-category, #page-tag { #page-category, #page-tag {
ul>li { ul > li {
line-height: 1.5rem; line-height: 1.5rem;
padding: .6rem 0; padding: 0.6rem 0;
&::before { // dot &::before { // dot
background: #999; background: #999;
width: 5px; width: 5px;
@ -21,25 +21,25 @@
display: block; display: block;
content: ""; content: "";
position: relative; position: relative;
top: .6rem; top: 0.6rem;
margin-right: .5rem; margin-right: 0.5rem;
} }
>a { /* post's title */ > a { /* post's title */
font-size: 1.1rem; font-size: 1.1rem;
@extend %no-bottom-border; @extend %no-bottom-border;
} }
>span:last-child { > span:last-child {
white-space: nowrap; white-space: nowrap;
} }
/* post's date */ /* post's date */
} }
} }
#page-tag h1>i { // tag icon #page-tag h1 > i { // tag icon
font-size: 1.2rem; font-size: 1.2rem;
} }
#page-category h1>i { #page-category h1 > i {
font-size: 1.25rem; font-size: 1.25rem;
} }
@ -59,11 +59,11 @@ a:hover {
@media all and (max-width: 576px) { @media all and (max-width: 576px) {
#page-category, #page-tag { #page-category, #page-tag {
ul>li { ul > li {
&::before { &::before {
margin: 0 .5rem; margin: 0 .5rem;
} }
>a { > a {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;

View file

@ -10,7 +10,7 @@
#post-list { #post-list {
margin-top: 1rem; margin-top: 1rem;
padding-right: .5rem; padding-right: 0.5rem;
.post-preview { .post-preview {
padding-top: 1.5rem; padding-top: 1.5rem;
@ -21,13 +21,13 @@
font-size: 1.4rem; font-size: 1.4rem;
margin: 0; margin: 0;
~i { // pinned icon ~i { // pinned icon
font-size: .86rem; font-size: 0.86rem;
} }
} }
.post-meta { .post-meta {
i { i {
font-size: .73rem; font-size: 0.73rem;
&:not(:first-child) { // post-meta icons on the homepage &:not(:first-child) { // post-meta icons on the homepage
margin-left: 1.5rem; margin-left: 1.5rem;
} }
@ -35,8 +35,8 @@
} }
.post-content { .post-content {
margin-top: .6rem; margin-top: 0.6rem;
margin-bottom: .6rem; margin-bottom: 0.6rem;
color: var(--post-list-text-color); color: var(--post-list-text-color);
>p { >p {
/* Make preview shorter on the homepage */ /* Make preview shorter on the homepage */
@ -128,7 +128,7 @@
} }
.pagination { .pagination {
font-size: .85rem; font-size: 0.85rem;
.page-item .page-link { .page-item .page-link {
width: 2.2rem; width: 2.2rem;
height: 2.2rem; height: 2.2rem;

View file

@ -89,20 +89,20 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
p { p {
font-size: 1.1rem; font-size: 1.1rem;
line-height: 1.5rem; line-height: 1.5rem;
margin-top: .3rem; margin-top: 0.3rem;
white-space: normal; white-space: normal;
} }
a, span { a, span {
&::before { &::before {
color: var(--text-muted-color); color: var(--text-muted-color);
font-size: .65rem; font-size: 0.65rem;
text-transform: uppercase; text-transform: uppercase;
} }
&:first-child { &:first-child {
border-top-right-radius: 0; border-top-right-radius: 0;
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
left: .5px; left: 0.5px;
&::before { &::before {
content: $prompt-older content: $prompt-older
} }
@ -110,7 +110,7 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
&:last-child { &:last-child {
border-top-left-radius: 0; border-top-left-radius: 0;
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
right: .5px; right: 0.5px;
&::before { &::before {
content: $prompt-newer content: $prompt-newer
} }
@ -148,8 +148,8 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
#toc li>a { #toc li>a {
line-height: 1rem; line-height: 1rem;
padding-top: .5rem; padding-top: 0.5rem;
padding-bottom: .5rem; padding-bottom: 0.5rem;
} }
@ -181,8 +181,8 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
} }
p { p {
font-size: .9rem; font-size: 0.9rem;
margin-bottom: .5rem; margin-bottom: 0.5rem;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
@ -233,7 +233,7 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
font-size: 1.2rem; font-size: 1.2rem;
a { a {
&:not(:last-child) { &:not(:last-child) {
margin-right: .25rem; margin-right: 0.25rem;
} }
&:hover { &:hover {
text-decoration: none; text-decoration: none;
@ -243,7 +243,7 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
} }
} }
>i { >i {
padding-top: .35rem; padding-top: 0.35rem;
&:hover { &:hover {
@extend %btn-share-hovor; @extend %btn-share-hovor;
} }
@ -291,7 +291,7 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
font-weight: 400; font-weight: 400;
} }
span:last-child { span:last-child {
font-size: .85rem; font-size: 0.85rem;
} }
} // .license-wrapper } // .license-wrapper
@ -320,8 +320,8 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
content: "\2022"; content: "\2022";
color: rgba(158, 158, 158, 0.8); color: rgba(158, 158, 158, 0.8);
font-weight: bold; font-weight: bold;
padding-left: .5rem; padding-left: 0.5rem;
padding-right: .3rem; padding-right: 0.3rem;
} }
&.flex-column { &.flex-column {
-webkit-box-orient: horizontal!important; -webkit-box-orient: horizontal!important;

View file

@ -12,7 +12,7 @@
.tag { .tag {
border-radius: 0.7em; border-radius: 0.7em;
padding: 6px 8px 7px; padding: 6px 8px 7px;
margin-right: .8rem; margin-right: 0.8rem;
line-height: 3rem; line-height: 3rem;
letter-spacing: 0; letter-spacing: 0;
border: 1px solid var(--tag-border) !important; border: 1px solid var(--tag-border) !important;