perf(shian): overhaul styling to minimize CSS processing

BREAKING CHANGE: several styles are rewritten completely for performance reasons. please update accordingly.
This commit is contained in:
Damillora 2021-04-22 20:29:31 +07:00
parent c4540bfe26
commit 2a23ca143f
13 changed files with 269 additions and 275 deletions

View File

@ -19,3 +19,4 @@
@import './components/gameitem';
@import './components/copyarea';
@import './components/floatingyuriko';
@import './components/tag';

View File

@ -58,7 +58,7 @@ body {
.main {
margin-left: auto;
margin-right: auto;
}
p,
h1,
h2,
@ -127,7 +127,6 @@ body {
padding: 0.5rem;
border: 1px solid var(--accent-color);
}
}
.card-list {
display: flex;

View File

@ -4,7 +4,7 @@
bottom: 1rem;
margin-bottom: 0px;
cursor: pointer;
img {
&__image {
height: 20vh;
}
}
@ -22,7 +22,9 @@
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.hvr-float:hover, .hvr-float:focus, .hvr-float:active {
.hvr-float:hover,
.hvr-float:focus,
.hvr-float:active {
-webkit-transform: translateY(-8px);
transform: translateY(-8px);
}

View File

@ -27,15 +27,15 @@
justify-content: center;
align-items: center;
&.hidden {
&--hidden {
height: 0;
opacity: 0;
visibility: hidden;
}
img {
max-height: 100%;
}
&__popup-image {
max-height: 100%;
}
&__exit {

View File

@ -24,13 +24,13 @@
@include my(0.5rem);
display: block;
p {
flex-shrink: 1;
}
&__text {
@include my(0.25rem);
white-space: nowrap;
text-align: right;
}
flex-shrink: 1;
}
&__icon {
padding: 0.5rem;
vertical-align: middle;

View File

@ -60,9 +60,6 @@
}
&__title {
flex-grow: 1;
@include transition;
a {
display: flex;
flex-direction: row;
align-items: center;
@ -74,9 +71,11 @@
font-size: $text-lg;
padding-left: 1rem;
height: 100%;
}
flex-grow: 1;
@include transition;
&:hover {
background-color: $theme-blue;
text-decoration: none;
}
}
@ -94,7 +93,8 @@
&:hover {
background-color: $theme-blue;
}
p {
}
&__nav-button-text {
color: $white;
margin-right: 0.5rem;
display: none;
@ -102,7 +102,6 @@
display: block;
}
}
}
&__icon {
width: 3rem;
color: $white;

View File

@ -16,9 +16,8 @@
width: 100%;
@include my(0.5rem);
display: block;
p {
}
&__text {
@include my(0.25rem);
}
}
}

View File

@ -18,15 +18,16 @@
&:hover {
background-color: $theme-blue;
}
}
a {
&__link {
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
height: 100%;
}
i {
&__icon {
display: inline-block;
width: 4rem;
height: 3rem;
@ -35,12 +36,12 @@
@include px(0.5rem);
@include py(0.75rem);
}
p {
&__text {
display: inline-block;
flex-grow: 1;
color: $white;
@include px(1rem);
}
}
&__separator {
margin-left: 5rem;
margin-right: 4rem;

View File

@ -10,6 +10,13 @@
display: flex;
align-items: flex-end;
&__heading {
color: $white;
@include my(0.5rem);
}
&__text {
@include my(0.5rem);
}
&__background {
position: absolute;
top: 0;
@ -34,15 +41,6 @@
padding-top: 4rem;
}
color: $white;
a,
h1,
h2,
h3,
h4,
h5,
h6 {
color: $white;
}
}
&__icon {

View File

@ -18,14 +18,14 @@
min-width: 300px;
max-width: 450px;
}
img {
}
&__image-inner {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
}
&__image::after {
display: block;
content: '';
@ -74,6 +74,7 @@
color: var(--accent-color);
font-size: $text-xl;
font-weight: 300;
@include my(0rem);
@include screen(md) {
font-size: $text-2xl;
@ -84,10 +85,12 @@
}
&__time {
@include my(0rem);
font-size: $text-xs;
}
&__author-list {
@include my(0rem);
font-size: $text-xs;
display: flex;
flex-direction: row;
@ -98,26 +101,18 @@
&__author-images {
display: flex;
flex-direction: row;
}
&__author-image {
height: 2rem;
margin-left: 0.25rem;
margin-right: 0.75rem;
img {
border-radius: 9999px;
height: 100%;
}
&__author-image {
border-radius: 9999px;
height: 2rem;
}
&__author-names {
display: flex;
flex-direction: column;
flex-grow: 1;
justify-content: center;
a:hover {
text-decoration: underline;
}
}
&__excerpt {
margin-top: 0.5rem;

View File

@ -1,65 +1,43 @@
.post-header {
h1,
h2,
h3,
h4,
h5,
h6,
p {
&__heading {
@include my(0.5rem);
}
&__tag-row {
padding-top: 1rem;
@include screen(md) {
padding-top: 0;
}
* {
display: inline-block;
padding-right: 0.25rem;
}
}
&__tag-heading {
&--tag {
display: flex;
flex-direction: row;
h1 {
align-items: center;
}
&--tag-text {
margin-left: 0.5rem;
color: $white;
}
}
&__tag-heading-color {
&--tag-color {
display: inline-block;
border-radius: 9999px;
vertical-align: text-bottom;
height: 4rem;
width: 4rem;
}
&__tag-color {
}
&__tag-row {
padding-top: 1rem;
@include screen(md) {
padding-top: 0;
}
}
&__tag-info {
display: inline-block;
border-radius: 9999px;
vertical-align: text-bottom;
height: 1rem;
width: 1rem;
}
&__tag-name {
font-size: $text-base;
&:hover {
text-decoration: underline;
}
}
&__paywall {
font-size: $text-base;
&:hover {
text-decoration: underline;
}
color: var(--accent-color);
padding-right: 0.25rem;
}
&__time {
font-size: $text-sm;
@include my(0.5rem);
}
&__title {
color: $white;
@include my(0.5rem);
}
&__author-list {
font-size: $text-sm;
display: flex;
@ -71,25 +49,21 @@
&__author-images {
display: flex;
flex-direction: row;
}
&__author-image {
height: 2rem;
align-items: center;
margin-left: 0.25rem;
margin-right: 0.75rem;
img {
border-radius: 9999px;
height: 100%;
}
&__author-image {
border-radius: 9999px;
height: 2rem;
}
&__author-names {
display: flex;
flex-direction: column;
flex-grow: 1;
justify-content: center;
a:hover {
text-decoration: underline;
}
}
&__author-name {
color: $white;
}
}

View File

@ -58,9 +58,6 @@
&__nav-content {
display: flex;
flex-direction: column;
p {
margin: 0;
}
&--previous-post {
align-items: start;
@ -77,7 +74,11 @@
}
}
}
&__nav-indicator {
margin: 0;
}
&__nav-title {
margin: 0;
font-size: $text-xl;
color: var(--accent-color);
}

View File

@ -0,0 +1,25 @@
.tag {
&__color {
display: inline-block;
border-radius: 9999px;
vertical-align: text-bottom;
height: 1rem;
width: 1rem;
}
&__name {
font-size: $text-base;
&:hover {
text-decoration: underline;
}
&--post-header {
color: $white;
}
}
&__paywall {
font-size: $text-base;
&:hover {
text-decoration: underline;
}
color: var(--accent-color);
}
}