feat: refactor css style and rm useless style

This commit is contained in:
Dillon
2022-05-15 15:15:38 +08:00
parent aa834e89af
commit de88a28db7
13 changed files with 55 additions and 43 deletions

View File

@@ -1,9 +1,9 @@
html { html {
font-family: $global-font-family; font-family: var(--global-font-family);
font-weight: $global-font-weight; font-weight: var(--global-font-weight);
font-display: swap; font-display: swap;
font-size: $global-font-size; font-size: var(--global-font-size);
line-height: $global-line-height; line-height: var(--global-line-height);
width:100%; width:100%;
scroll-behavior: smooth; scroll-behavior: smooth;
@@ -47,15 +47,11 @@ body {
} }
} }
@include ms;
@include link(true, true); @include link(true, true);
@import "../_partial/mask"; @import "../_partial/mask";
@import "../_partial/img";
@import "../_partial/icon"; @import "../_partial/icon";
@import "../_partial/details"; @import "../_partial/details";
@import "../_partial/fixed-button"; @import "../_partial/fixed-button";
@import "../_partial/cookieconsent"; @import "../_partial/cookieconsent";
img {
@include object-fit(contain);
}

View File

@@ -0,0 +1,6 @@
:root {
--global-font-family: #{$global-font-family};
--global-font-size: #{$global-font-size};
--global-font-weight: #{$global-font-weight};
--global-line-height: #{$global-line-height};
}

View File

@@ -97,12 +97,6 @@
line-break: $value; line-break: $value;
} }
@mixin ms {
input::-ms-clear {
display: none;
}
}
@mixin object-fit($value) { @mixin object-fit($value) {
-o-object-fit: $value; -o-object-fit: $value;
object-fit: $value; object-fit: $value;

View File

@@ -2,19 +2,35 @@
a, a::before, a::after { a, a::before, a::after {
text-decoration: none; text-decoration: none;
color: if($light, $global-link-color, $single-link-color); @if $light {
color: $global-link-color;
} @else {
color: $single-link-color;
}
[theme=dark] & { [theme=dark] & {
color: if($dark, $global-link-color-dark, $single-link-color-dark); @if $dark {
color: $global-link-color-dark;
} @else {
color: $single-link-color-dark;
}
} }
} }
a:active, a:active,
a:hover { a:hover {
color: if($light, $global-link-hover-color, $single-link-hover-color); @if $light {
color: $global-link-hover-color;
} @else {
color: $single-link-hover-color;
}
[theme=dark] & { [theme=dark] & {
color: if($dark, $global-link-hover-color-dark, $single-link-hover-color-dark); @if $dark {
color: $global-link-hover-color-dark;
} @else {
color: $single-link-hover-color-dark;
}
} }
} }
} }

View File

@@ -100,11 +100,10 @@
height: 100%; height: 100%;
left: 0; left: 0;
top: 0; top: 0;
@include object-fit(none);
}
img.lazyloaded { &.lazyloaded {
@include object-fit(cover); @include object-fit(cover);
}
} }
&:hover { &:hover {

View File

@@ -237,14 +237,6 @@
} }
} }
.lazyload, .lazyloading {
@include object-fit(scale-down);
}
.lazyloaded {
@include object-fit(fill);
}
blockquote { blockquote {
display: block; display: block;
border-left: .5rem solid $blockquote-color; border-left: .5rem solid $blockquote-color;
@@ -330,10 +322,10 @@
white-space: pre-wrap; white-space: pre-wrap;
} }
--ti-cursor-font-family: $global-font-family; --ti-cursor-font-family: var(--global-font-family);
--ti-cursor-font-size: $global-font-size; --ti-cursor-font-size: var(--global-font-size);
--ti-cursor-font-weight: $global-font-weight; --ti-cursor-font-weight: var(--global-font-weight);
--ti-cursor-line-height: $global-line-height; --ti-cursor-line-height: var(--global-line-height);
--ti-cursor-color: $global-font-secondary-color; --ti-cursor-color: $global-font-secondary-color;
--ti-cursor-margin-left: 0; --ti-cursor-margin-left: 0;

View File

@@ -0,0 +1,9 @@
img {
&.lazyload, &.lazyloading {
@include object-fit(scale-down);
}
&.lazyloaded {
@include object-fit(contain);
}
}

View File

@@ -67,7 +67,7 @@ code, pre, .highlight table, .highlight tr, .highlight td {
align-items: center; align-items: center;
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
font-family: $global-font-family; font-family: var(--global-font-family);
font-weight: bold; font-weight: bold;
color: $code-info-color; color: $code-info-color;
background: darken($code-background-color, 8%); background: darken($code-background-color, 8%);

View File

@@ -1,21 +1,21 @@
@charset "utf-8"; @charset "utf-8";
@import "../lib/normalize/normalize";
@import "_variables"; @import "_variables";
@import "_override"; @import "_override";
@import "_core/variables";
@import "_mixin/index"; @import "_mixin/index";
@import "../lib/normalize/normalize";
@import "_core/base"; @import "_core/base";
@import "_core/layout"; @import "_core/layout";
@import "_page/index"; @import "_page/index";
@import "_partial/header"; @import "_core/header";
@import "_partial/footer"; @import "_core/footer";
@import "_partial/pagination"; @import "_core/pagination";
@import "_core/media"; @import "_core/media";
@import "_custom"; @import "_custom";

File diff suppressed because one or more lines are too long