Skip to content

Commit

Permalink
refactor: main.scss and scss folder structure
Browse files Browse the repository at this point in the history
closes #52

BREAKING CHANGE: scss folder structure is changed
  • Loading branch information
reuixiy committed Feb 20, 2020
1 parent 262ddb1 commit abba97f
Show file tree
Hide file tree
Showing 53 changed files with 530 additions and 374 deletions.
16 changes: 0 additions & 16 deletions assets/scss/_common/fonts-src.scss

This file was deleted.

22 changes: 0 additions & 22 deletions assets/scss/_common/footer.scss

This file was deleted.

8 changes: 0 additions & 8 deletions assets/scss/_common/header.scss

This file was deleted.

36 changes: 0 additions & 36 deletions assets/scss/_common/responsive.scss

This file was deleted.

1 change: 0 additions & 1 deletion assets/scss/_variables/max-width.scss

This file was deleted.

8 changes: 4 additions & 4 deletions assets/scss/_common/base.scss → assets/scss/base/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ html, body {
}

body {
font-size: $fontSize;
font-size: var(--font-size);
tab-size: $tabSize;
color: var(--color-contrast-high);
background-color: var(--color-bg);
Expand Down Expand Up @@ -81,8 +81,8 @@ a {
}

::-webkit-scrollbar {
width: $fontSize * 0.4;
height: $fontSize * 0.2;
width: calc(var(--font-size) * 0.4);
height: calc(var(--font-size) * 0.2);
}
::-webkit-scrollbar-track {
background-color: var(--color-bg);
Expand All @@ -95,4 +95,4 @@ a {
&:active {
background-color: alpha(var(--color-primary), 0.75);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
display: table;
margin: 0 auto;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
text-emphasis-position: under;
-webkit-text-emphasis-position: under;
-moz-text-emphasis-position: under;
}
}
File renamed without changes.
18 changes: 18 additions & 0 deletions assets/scss/base/_glyph-correction.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@font-face {
font-family: 'glyph-correction';
font-display: swap;
font-weight: inherit;
font-style: inherit;
src: url('/fonts/glyph-correction.woff2') format('woff2'),
url('/fonts/glyph-correction.woff') format('woff'),
url('/fonts/glyph-correction.ttf') format('truetype'),
url('/fonts/glyph-correction.eot') format('embedded-opentype');
unicode-range: U+00B7, U+2014, U+2022, U+2026;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

.drop-cap {
margin-top: var(--font-size) !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
margin: 1em 0;
}
pre, .highlight {
margin: $fontSize 0;
margin: var(--font-size) 0;
}
h1, h2, h3, h4, h5, h6 {
text-align: center;
Expand Down Expand Up @@ -57,4 +57,4 @@
}
}
}
}
}
1 change: 1 addition & 0 deletions assets/scss/base/_max-width.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$maxWidth: $fontSize * (strip-unit($greaterWidth) + 5);
18 changes: 18 additions & 0 deletions assets/scss/base/_responsive.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@media (max-width: $maxWidth) {
.main-inner {
width: auto !important;
}
.anchor-link {
position: relative;
transform: none;
float: right;
}
.menu {
display: flex;
justify-content: space-around;
word-break: break-all;
}
.menu-item {
margin: 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
.back-to-top {
bottom: 0;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
&:hover {
background-color: alpha(var(--color-primary), 0.3);
}
}
}
11 changes: 11 additions & 0 deletions assets/scss/components/_dark-mode.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#theme-toggle {
padding: 1em;
cursor: pointer;
float: right;
position: relative;
z-index: 4;
}

[data-theme="dark"] img {
filter: brightness(50%);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.highlight {
font-size: 0.8em;
margin: ($fontSize * 2) 0;
margin: calc(var(--font-size) * 2) 0;
pre {
margin: 0 !important;
overflow: auto hidden;
Expand All @@ -22,4 +22,9 @@ span.lnt {
margin-right: -1em !important;
padding: 0 !important;
text-align: right;
}
}

.chroma, .chroma-dark {
color: var(--color-contrast-high);
background-color: alpha(var(--color-contrast-lower), 0.5);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.minimal-footer-about {
font-size: 80%;
margin-top: ($fontSize * 5);
margin-top: calc(var(--font-size) * 5);
display: flex;
justify-content: space-between;
align-items: baseline;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.minimal-footer {
font-size: 80%;
margin-top: ($fontSize * 5);
margin-top: calc(var(--font-size) * 5);
display: flex;
justify-content: space-between;
align-items: baseline;
Expand All @@ -24,4 +24,4 @@

.post-tag-link, .post-category-link, .post-category {
color: alpha(var(--color-contrast-medium), 0.9);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
padding: 0;
list-style: none;
display: none;
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.post-gitinfo {
font-size: 70%;
margin-top: ($fontSize * 5);
margin-top: calc(var(--font-size) * 5);
display: flex;
justify-content: space-between;
color: alpha(var(--color-contrast-medium), 0.8);
Expand Down Expand Up @@ -31,4 +31,4 @@

.git-icon, .msg-icon, .feedback-icon, .edit-icon {
margin: 0 0.3em 0.3em 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
color: var(--color-contrast-medium);
font-size: 80%;
text-align: center;
margin: $fontSize 0;
margin: var(--font-size) 0;
a {
color: var(--color-contrast-medium);
&:hover {
Expand All @@ -13,7 +13,7 @@

.home {
.post-meta {
margin: $fontSize 0;
margin: var(--font-size) 0;
}
}

Expand All @@ -25,4 +25,4 @@
.post-meta-icon {
fill: alpha(var(--color-contrast-medium), 0.5);
margin-bottom: 0.3em;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
margin-left: auto;
text-align: right;
max-width: 42%;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.post-share {
margin-top: ($fontSize * 5);
margin-top: calc(var(--font-size) * 5);
color: alpha(var(--color-contrast-medium), 0.8);
a {
color: alpha(var(--color-contrast-medium), 0.8);
Expand Down Expand Up @@ -107,4 +107,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.post-tags {
margin-top: ($fontSize * 5);
margin-top: calc(var(--font-size) * 5);
text-align: center;
font-size: 90%;
}
Expand All @@ -14,4 +14,4 @@
.tag-icon {
margin-right: 0.3em;
font-size: 80%;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
.related-link {
line-height: 1.5;
display: inline-block;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@

.updated-badge-right {
fill: alpha(var(--color-primary), 0.5);
}
}
File renamed without changes.
45 changes: 45 additions & 0 deletions assets/scss/layout/_footer.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.footer {
position: absolute;
bottom: 0;
width: 100%;
font-size: 90%;
color: var(--color-contrast-medium);
a {
color: var(--color-contrast-medium);
&:hover {
color: var(--color-primary);
}
}
}

.footer-inner {
padding: 1em;
text-align: center;
}

.footer-icon {
margin: 0 0.25em 0.3em;
}

@if variable-exists("iconColor") {
.footer-icon {
fill: $iconColor;
}
}

@if ($iconAnimation) {
@keyframes heartbeat {
0%, 100% {
transform: scale(1);
}
10%, 30% {
transform: scale(0.9);
}
20%, 40%, 50%, 60%, 70%, 80% {
transform: scale(1.1);
}
}
.footer-icon {
animation: heartbeat 1.33s ease-in-out infinite;
}
}
Loading

1 comment on commit abba97f

@reuixiy
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.