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

133 lines
5.6 KiB
Stylus
Raw Normal View History

// ========================================================================
// THEME VARIABLE //
// ========================================================================
2020-04-01 23:03:38 +08:00
// ========================================================================
// layout
// ========================================================================
2020-11-18 11:15:03 +08:00
$header-height = 72px; //
$main-content-width = 62%; // PC
$main-content-width-tablet = 80%; //
$main-content-width-mobile = 88%; //
$header-shrink-height = 56px; //
$circle-button-width = 40px; // tools
$tools-button-width = 32px; // tools
$component-interspace = 30px; // /PC
2020-04-29 18:41:29 +08:00
// ========================================================================
2020-04-29 18:41:29 +08:00
//
// ========================================================================
2020-11-18 11:15:03 +08:00
$media-max-width = 780px; // ()
$media-max-width-mobile = 500px; //
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-01 23:03:38 +08:00
// z-index
// ========================================================================
$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;
$z-index-9 = 1009;
2020-04-01 22:42:24 +08:00
// ========================================================================
// color
// ========================================================================
2020-11-13 14:43:22 +08:00
// primary color
$temp-color = hexo-config('style.primary_color');
2020-11-18 11:15:03 +08:00
$primary-color = $temp-color ? convert($temp-color) : #0066CC;
// ====================== light mode color ======================
$background-color = #fff;
$second-background-color = darken($background-color, 2%);
$default-text-color = #3f3f3f;
$first-text-color = darken($default-text-color, 10%);
$second-text-color = darken($default-text-color, 5%);
$third-text-color = lighten($default-text-color, 40%);
$fourth-text-color = lighten($default-text-color, 90%);
$border-color = darken($background-color, 30%);
$selection-color = lighten($primary-color, 10%);
2020-11-15 22:06:32 +08:00
$shadow-color = rgba(0, 0, 0, 0.2);
$shadow-hover-color = rgba(0, 0, 0, 0.28);
2020-11-18 11:15:03 +08:00
$scroll-bar-color = lighten($default-text-color, 20%);
$scroll-bar-bg-color = darken($background-color, 10%);
2020-11-18 11:15:03 +08:00
// ====================== dark mode color ======================
2020-04-03 18:18:42 +08:00
$dark-primary-color = $primary-color;
2020-11-13 14:43:22 +08:00
$dark-background-color = #2f2e31;
2020-11-15 22:06:32 +08:00
$dark-second-background-color = darken($dark-background-color, 2%);
2020-11-18 11:15:03 +08:00
$dark-default-text-color = #b9b5c2;
$dark-first-text-color = lighten($dark-default-text-color, 30%);
$dark-second-text-color = lighten($dark-default-text-color, 20%);
$dark-third-text-color = darken($dark-default-text-color, 20%);
$dark-fourth-text-color = darken($dark-default-text-color, 80%);
$dark-border-color = lighten($dark-background-color, 20%);
2020-04-03 18:18:42 +08:00
$dark-selection-color = $selection-color;
2020-11-15 22:06:32 +08:00
$dark-shadow-color = rgba(128, 128, 128, 0.2);
$dark-shadow-hover-color = rgba(128, 128, 128, 0.28);
2020-11-18 11:15:03 +08:00
$dark-scroll-bar-color = darken($dark-default-text-color, 30%);
$dark-scroll-bar-bg-color = lighten($dark-background-color, 10%);
2020-04-01 22:42:24 +08:00
// ========================================================================
// font
// ========================================================================
2020-11-17 11:50:11 +08:00
$default-font-family = Optima-Regular, Optima, -apple-system, system-ui, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial;
2020-09-09 16:30:18 +08:00
$default-font-size = 15.2px;
2020-11-13 14:43:22 +08:00
$default-font-line-height = 22px;
$default-font-weight = 400;
// ========================================================================
2020-11-17 18:21:16 +08:00
// light/dark mode color
// ========================================================================
2020-11-17 18:21:16 +08:00
root-color(mode) {
--background-color: mode == 'light' ? $background-color : $dark-background-color;
--second-background-color: mode == 'light' ? $second-background-color : $dark-second-background-color;
--primary-color: mode == 'light' ? $primary-color : $dark-primary-color;
--first-text-color: mode == 'light' ? $first-text-color : $dark-first-text-color;
--second-text-color: mode == 'light' ? $second-text-color : $dark-second-text-color;
--third-text-color: mode == 'light' ? $third-text-color : $dark-third-text-color;
--fourth-text-color: mode == 'light' ? $fourth-text-color : $dark-fourth-text-color;
2020-11-18 11:15:03 +08:00
--normal-text-color: mode == 'light' ? $default-text-color : $dark-default-text-color;
2020-11-17 18:21:16 +08:00
--border-color: mode == 'light' ? $border-color : $dark-border-color;
--selection-color: mode == 'light' ? $selection-color : $dark-selection-color;
--shadow-color: mode == 'light' ? $shadow-color : $dark-shadow-color;
--shadow-hover-color: mode == 'light' ? $shadow-hover-color : $dark-shadow-hover-color;
--scroll-bar-color: mode == 'light' ? $scroll-bar-color : $dark-scroll-bar-color;
2020-11-18 11:15:03 +08:00
--scroll-bar-bg-color: mode == 'light' ? $scroll-bar-bg-color : $dark-scroll-bar-bg-color;
2020-11-15 22:06:32 +08:00
}
:root {
2020-11-17 18:21:16 +08:00
root-color('light');
2020-11-15 22:06:32 +08:00
}
@media (prefers-color-scheme: dark) {
:root {
2020-11-17 18:21:16 +08:00
root-color('dark');
2020-11-15 22:06:32 +08:00
}
}
2020-11-17 18:21:16 +08:00
.light-mode {
root-color('light');
}
2020-11-17 18:21:16 +08:00
.dark-mode {
root-color('dark');
2020-07-09 18:24:13 +08:00
}