mini-dlpu-v3/miniprogram/app.scss
2022-06-10 12:33:38 +08:00

130 lines
2.5 KiB
SCSS

$theme-color-blue: #3EA3D8;
$theme-color-red: #FF9393;
$theme-color-light-layout: #F8F8F8;
$theme-color-light-background: #f4f0f1;
$theme-color-light-title: rgba(0, 0, 0, .65);
$theme-color-light-text: rgba(0, 0, 0, .5);
$theme-color-light-line: rgba(0, 0, 0, .25);
$theme-color-dark-layout: #1f1f1f;
$theme-color-dark-background: #181615;
$theme-color-dark-title: rgba(255, 255, 255, .65);
$theme-color-dark-text: rgba(255, 255, 255, .5);
$theme-color-dark-line: rgba(255, 255, 255, .25);
$black-filter: brightness(0) opacity(.65);
$white-filter: brightness(100) opacity(.65);
$blue-filter: opacity(1);
$green-filter: hue-rotate(-110deg) opacity(1);
@mixin container {
width: 88%;
padding: 0 6%;
}
// 页面容器外边距
view.container {
@include container;
}
// 带阴影的 card
view.card {
width: calc( 100% - 40px );
padding: 0 20px;
border-radius: 15px;
background-color: $theme-color-light-layout;
box-shadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, .08),
0 0.3px 0.9px 0 rgba(0, 0, 0, .05);
}
image.icon {
filter: $black-filter;
}
image.icon-sub {
filter: $black-filter;
opacity: .6;
}
// 顶部导航栏阴影
view.top-shadow {
position: fixed;
z-index: 9999;
width: 100%;
height: 10px;
top: -10px;
box-shadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, .05);
}
page {
background-color: $theme-color-light-background;
color: $theme-color-light-text;
}
view, text {
font-size: .97em;
letter-spacing: .1em;
font-family: Hiragino Sans GB, MicroSoft YaHei;
}
view.h1 {
color: $theme-color-light-title;
font-size: 1.5em;
letter-spacing: .1em;
}
view.h2 {
color: $theme-color-light-title;
font-size: 1.3em;
letter-spacing: .1em;
}
view.h3 {
color: $theme-color-light-title;
font-size: 1em;
letter-spacing: .1em;
}
view.button {
color: white;
background-color: $theme-color-blue;
text-align: center;
padding: 10px;
border-radius: 10px;
}
@media (prefers-color-scheme: dark){
page {
background-color: $theme-color-dark-background;
color: $theme-color-dark-text;
}
view.card {
background-color: $theme-color-dark-layout;
}
image.icon {
filter: $white-filter;
}
image.icon-sub {
filter: $white-filter;
}
view.h1 {
color: $theme-color-dark-title;
font-size: 1.2em;
}
view.h2 {
color: $theme-color-dark-title;
font-size: 1.3em;
}
view.h3 {
color: $theme-color-dark-title;
font-size: 1em;
}
}