1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-24 08:37:13 +00:00

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

View File

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