🎨 Style: add theme colors variables and add common color styles

This commit is contained in:
Cell
2022-07-10 16:24:38 +08:00
parent 46eefcebbc
commit 38314a5d0f
5 changed files with 37 additions and 1 deletions
+1
View File
@@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file.
- :bug: Fix: Giscus comments invalid config `inputPosition`
- :bug: Fix: busuanzi logic error
- :bug: Fix: close comment system logic error when the article was expired
- :art: Style: add theme colors variables and add common color styles
- :art: Style: add scroll bar for auto toc ([#136](https://github.com/Lruihao/FixIt/issues/136))
- :wrench: Feat(cdn): add unpkg cdn support
- :arrow_up: Chore(libs): update some third-party libraries
+6
View File
@@ -39,4 +39,10 @@
}
.pe-1 {
padding-right: 0.25rem !important;
}
@each $color, $value in $theme-colors {
.text-#{$color} {
color: #{$value} !important;
}
}
+7
View File
@@ -0,0 +1,7 @@
:root {
// Note: Custom variable values only support SassScript inside `#{}`.
@each $color, $value in $theme-colors {
--#{$prefix}#{$color}: #{$value};
}
}
+22 -1
View File
@@ -3,6 +3,9 @@
// ==============================
// ========== Global ========== //
// Prefix for :root CSS variables.
$prefix: fi- !default;
// Font and Line Height
$global-font-family: system-ui, -apple-system, BlinkMacSystemFont, PingFang SC, Microsoft YaHei UI, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, Helvetica, Arial, sans-serif !default;
$global-font-size: 16px;
@@ -35,6 +38,24 @@ $global-link-hover-color-dark: #fff !default;
// Color of the border
$global-border-color: #f0f0f0 !default;
$global-border-color-dark: #363636 !default;
// Theme colors
$primary: #1772ee !default;
$secondary: #919191 !default;
$success: #13ce66 !default;
$info: #0dcaf0 !default;
$warning: #ffba00 !default;
$danger: #ff4949 !default;
// Theme colors map
$theme-colors: (
'primary': $primary,
'secondary': $secondary,
'success': $success,
'info': $info,
'warning': $warning,
'danger': $danger
) !default;
// ========== Global ========== //
// ========== Scrollbar ========== //
@@ -94,7 +115,7 @@ $table-thead-color: #ededed !default;
$table-thead-color-dark: #20252b !default;
// Color of the blockquote
$blockquote-color: #697681 !default;
$blockquote-color: #697681 !default;
$blockquote-color-dark: #9ba3aa !default;
// ========== Single Content ========== //
+1
View File
@@ -5,6 +5,7 @@
@import "_mixin/index";
@import "_root";
@import "_core/base";
@import "_core/layout";