@qsxy/element-plus-react v1.0.0-next.17
@qsxy/element-plus-react
Usage
// how to use
import '@qsxy/element-plus-react/dist/index.css';
import { ElButton, ElLink } from '@qsxy/element-plus-react';Change the SCSS variable in the project
element-plus-react is using SCSS. If your project also uses SCSS, you can directly change the style variable of Element in the project. Create a new style file, such as element-variables.csss, and write the following content:
在项目中改变 SCSS 变量
element-plus-react 的 theme-chalk 使用 SCSS 编写,如果你的项目也使用了 SCSS,那么可以直接在项目中改变 Element 的样式变量。新建一个样式文件,例如 element-variables.scss,写入以下内容:
/ Change the theme color variable /
/ 改变主题色变量 /
@use 'sass:math';
@mixin set-color-mix-level($number, $mode: 'light', $--el-color-primary, $mix-color: #ffffff) {
--el-color-primary-#{$mode}-#{$number}: #{mix($mix-color, $--el-color-primary, math.percentage(math.div($number, 10)))};
}
// Theme color variable
// 主题色变量
$--el-color-primary: #4f8ffa;
:root {
// Theme color variable
// 主题色变量
--el-color-primary: #4f8ffa;
// Theme background color variable (button class)
// 主题背景颜色变量(按钮类)
--el-bg-color-primary: #4f8ffa;
// Theme border color variable (button class)
// 主题边框颜色变量(按钮类)
--btn-border-color: #48aff9;
@each $i in (3, 5, 7, 8, 9) {
@include set-color-mix-level($i, 'light', $--el-color-primary, #ffffff);
}
@include set-color-mix-level(2, 'dark', $--el-color-primary, #000000);
// dark mode 暗黑模式
&.is-dark {
--el-color-primary: #{mix(#141414, $--el-color-primary, 5)};
@each $i in (3, 5, 7, 8, 9) {
@include set-color-mix-level($i, 'light', $--el-color-primary, #141414);
}
@include set-color-mix-level(2, 'dark', $--el-color-primary, #141414);
}
}/ Change icon font path variable, required /
/ 改变 icon 字体路径变量,必需 /
$fa-font-path: '~@/assets/fonts';
@import '@qsxy/element-plus-react/theme-chalk/index.scss';Warm Reminder
Currently, this library is in the development and testing stage, and there may be some inevitable issues. If you encounter any problems, please feel free to raise an issue for me, and I will fix them as soon as possible.
目前该库为开发测试阶段,会有一些不可避免的问题,如果您发现了一些问题,欢迎提 Issues 给我,我会尽快修复
Development
# install dependencies
$ npm i @qsxy/element-plus-react
# It is recommended to use (to avoid React version conflicts)
# 推荐使用(避免react版本冲突)
$ pnpm add @qsxy/element-plus-reactLICENSE
MIT
6 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago