hexo-theme-keep/source/css/layout/common/variables.styl

148 lines
5.2 KiB
Stylus
Raw Normal View History

2020-04-30 12:24:57 +08:00
// ===================================
// THEME VARIABLE //
// ===================================
2020-04-01 23:03:38 +08:00
2020-04-30 12:24:57 +08:00
// ===================================
// layout
2020-04-30 12:24:57 +08:00
// ===================================
2020-04-29 18:41:29 +08:00
if (hexo-config('magic.enable')) {
2020-09-03 12:28:24 +08:00
$header-height = 80px; // magic
} else {
2020-09-03 12:28:24 +08:00
$header-height = 100px; // normal
}
$main-content-width = 62%; // PC
$main-content-width-tablet = 80%; //
$main-content-width-mobile = 88%; //
2020-07-09 18:24:13 +08:00
$header-shrink-height = 60px; //
2020-09-03 12:28:24 +08:00
$tool-button-width = 36px; // tools
2020-07-09 18:24:13 +08:00
$component-interspace = 30px; // /px
2020-04-29 18:41:29 +08:00
2020-04-30 12:24:57 +08:00
// ===================================
2020-04-29 18:41:29 +08:00
//
2020-04-30 12:24:57 +08:00
// ===================================
2020-07-09 18:24:13 +08:00
$media-max-width = 760px; // ()
$media-max-width-mobile = 480px; //
2020-06-04 22:11:27 +08:00
ils-tablet()
@media (max-width: $media-max-width)
{block}
ils-mobile()
@media (max-width: $media-max-width-mobile)
{block}
2020-04-29 18:41:29 +08:00
2020-04-30 12:24:57 +08:00
// ===================================
2020-04-01 23:03:38 +08:00
// z-index
2020-04-30 12:24:57 +08:00
// ===================================
$z-index-1 = 1001;
$z-index-2 = 1002;
$z-index-3 = 1003;
$z-index-4 = 1004;
$z-index-5 = 1005;
$z-index-6 = 1006;
$z-index-7 = 1007;
$z-index-8 = 1008;
2020-04-01 22:42:24 +08:00
2020-04-30 12:24:57 +08:00
// ===================================
// color
2020-04-30 12:24:57 +08:00
// ===================================
2020-04-03 18:18:42 +08:00
// normal mode color
2020-07-09 18:24:13 +08:00
$primary-color = rgba(30, 88, 217, 0.96); //
$background-color = #fff; // normal
2020-09-09 16:30:18 +08:00
$magic-background-color = #fafafa; // magic
2020-07-09 18:24:13 +08:00
$normal-text-color = #43404d; //
$first-text-color = darken($normal-text-color, 8%); //
$second-text-color = darken($normal-text-color, 4%); //
2020-06-04 22:11:27 +08:00
$third-text-color = lighten($normal-text-color, 40%); //
2020-07-09 18:24:13 +08:00
$fourth-text-color = #eee; //
$border-color = darken($background-color, 30%); //
$selection-color = lighten($primary-color, 20%); //
// dark mode color
2020-04-03 18:18:42 +08:00
$dark-primary-color = $primary-color;
2020-04-29 18:41:29 +08:00
$dark-background-color = #38373a;
$dark-magic-background-color = #2f2e31;
$dark-normal-text-color = #b9b5c2;
2020-04-03 18:18:42 +08:00
$dark-first-text-color = lighten($dark-normal-text-color, 30%);
$dark-second-text-color = lighten($dark-normal-text-color, 20%);
$dark-third-text-color = darken($dark-normal-text-color, 20%);
2020-04-29 18:41:29 +08:00
$dark-fourth-text-color = #2f2e31;
$dark-border-color = lighten($dark-background-color, 20%);
2020-04-03 18:18:42 +08:00
$dark-selection-color = $selection-color;
2020-04-01 22:42:24 +08:00
2020-04-30 12:24:57 +08:00
// ===================================
// font
2020-04-30 12:24:57 +08:00
// ===================================
2020-09-03 12:28:24 +08:00
// 'PingHei', 'PingFang SC', 'Microsoft YaHei';
// 'PingFang SC', 'Hiragino Sans GB', 'STHeiti Light';
// 'Microsoft YaHei', 'SimHei', 'WenQuanYi Micro Hei', sans-serif;
// "Exo 2", "Trebuchet MS", "Helvetica", "Arial";
2020-04-03 18:18:42 +08:00
$default-font-family = Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
2020-09-09 16:30:18 +08:00
$default-font-size = 15.2px;
$default-font-line-height = 20px;
$default-font-weight = 400;
2020-09-03 12:28:24 +08:00
// ===================================
// light/dark color
// ===================================
:root {
--background-color: $background-color;
--magic-background-color: $magic-background-color;
--primary-color: $primary-color;
--first-text-color: $first-text-color;
2020-04-26 18:34:51 +08:00
--fourth-text-color: $fourth-text-color;
--second-text-color: $second-text-color;
--third-text-color: $third-text-color;
--normal-text-color: $normal-text-color;
--border-color: $border-color;
2020-04-03 18:18:42 +08:00
--selection-color: $selection-color;
}
@media (prefers-color-scheme: dark) {
:root {
--background-color: $dark-background-color;
--magic-background-color: $dark-magic-background-color;
--primary-color: $dark-primary-color;
--first-text-color: $dark-first-text-color;
--second-text-color: $dark-second-text-color;
--third-text-color: $dark-third-text-color;
2020-04-26 18:34:51 +08:00
--fourth-text-color: $dark-fourth-text-color;
--normal-text-color: $dark-normal-text-color;
2020-04-03 18:18:42 +08:00
--border-color: $dark-border-color;
--selection-color: $dark-selection-color;
}
}
.dark-mode {
--background-color: $dark-background-color;
--magic-background-color: $dark-magic-background-color;
--primary-color: $dark-primary-color;
--first-text-color: $dark-first-text-color;
--second-text-color: $dark-second-text-color;
--third-text-color: $dark-third-text-color;
2020-04-26 18:34:51 +08:00
--fourth-text-color: $dark-fourth-text-color;
--normal-text-color: $dark-normal-text-color;
2020-04-03 18:18:42 +08:00
--border-color: $dark-border-color;
--selection-color: $dark-selection-color;
}
.light-mode {
--background-color: $background-color;
--magic-background-color: $magic-background-color;
--primary-color: $primary-color;
--first-text-color: $first-text-color;
--second-text-color: $second-text-color;
--third-text-color: $third-text-color;
2020-04-26 18:34:51 +08:00
--fourth-text-color: $fourth-text-color;
--normal-text-color: $normal-text-color;
--border-color: $border-color;
2020-04-03 18:18:42 +08:00
--selection-color: $selection-color;
2020-07-09 18:24:13 +08:00
}