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;
} }
@ -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
@ -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;
} }
} }
} }
@ -395,7 +395,7 @@ $sidebar-display: "sidebar-display";
} }
i { // icons i { // icons
color: #818182; color: #818182;
margin-right: .15rem; margin-right: 0.15rem;
font-size: 80%; font-size: 80%;
} }
> p { > p {
@ -527,7 +527,7 @@ footer {
@include panel-label; @include panel-label;
} }
.post-content { .post-content {
font-size: .9rem; font-size: 0.9rem;
} }
} }
@ -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;
@ -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 {
@ -813,7 +813,7 @@ div.post-content .table-wrapper {
@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;
} }
@ -1008,7 +1008,7 @@ div.post-content .table-wrapper {
> 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;
@ -1368,7 +1368,7 @@ 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;
} }
} }
@ -1408,7 +1408,7 @@ div.post-content .table-wrapper {
} }
.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;
@ -1437,7 +1437,7 @@ 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 {
@ -1457,8 +1457,8 @@ div.post-content .table-wrapper {
> 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;
} }

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

@ -116,7 +116,7 @@
/* 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;

View file

@ -52,7 +52,7 @@
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

@ -12,7 +12,7 @@
#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,8 +21,8 @@
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;

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;