这个方案就是覆盖Element Plus 默认提供一套主题; 1.在src/styles/ 文件夹下创建一个 index.scss 文件; 在index.scss 里,首先使用@forward导入 Element Plus 的变量,再设置elementplus的主题色; @forward "element-plus/theme-chalk/src/common/var.scss" with ($colors: ( "primary": ("base": pink), "...
Element Plus Version: 2.8.1 Browser / OS: chrome Build Tool: Vite Reproduction Related Component All Reproduction Link Element Plus Playground Steps to reproduce @forward "element-plus/theme-chalk/src/dark/var.scss" with ( $colors: ( "primary": ( "base": #007fff, ) ), $menu: ( "act...
// styles/element/index.scss/* 只需要重写你需要的即可 */@forward'element-plus/theme-chalk/src/common/var.scss'with($colors:('primary':('base':green,),),); 首先我们需要在src/assets/style/element里新建一个index.scss,因为我们后续还要覆盖暗黑模式的变量,所以我们要在同级目录新建一个light.scss...
也可以用scss直接覆盖,这种的话就是说你用scss新写样式覆盖原本的样式合成一个新的scss文件导入main.ts里面,不用import 'element-plus/dist/index.css'了 // styles/element/index.scss/*只需要重写你需要的即可*/@forward 'element-plus/theme-chalk/src/common/var.scss' with ( $colors: ( 'primary': (...
styles/element/index.scss 修改变量的文件 /** @format */ @use "sass:map"; $--colors: ( "primary": ( "base": #93040b, ), ); @forward "element-plus/theme-chalk/src/common/var.scss" with ( $colors: $--colors, $carousel: ( "indicator-width": 6px, "indicator-height": 6px, ...
popper-class="theme-picker-dropdown" /> </template> <script> export default { name: "ThemePicker", data() { return { chalk: "", // content of theme-chalk css themeColor: variables.mainTone }; }, mounted() { // 也可以从localStorage里拿值, 看个人需求 ...
Element-plus fix type error (#8982 by @holazz) Directives [mousewheel] fix type error (#8880 by @holazz) Theme-chalk [rate] fix vertical offset (#8959 by @Tsong-LC) Time-picker clicking on prefix does not open the panel (#9044 by @xiaoxian521) Components [slider] disabled slider butt...
🎉 A Vue.js 3 UI Library made by Element team. Contribute to element-plus/element-plus development by creating an account on GitHub.
Element-plus fix type error (#8982 by @holazz) Directives [mousewheel] fix type error (#8880 by @holazz) Theme-chalk [rate] fix vertical offset (#8959 by @Tsong-LC) Time-picker clicking on prefix does not open the panel (#9044 by @xiaoxian521) Components [slider] disabled slider butt...
scss // 自定义主题文件 custom-theme.scss @import"element-plus/packages/theme-chalk/src/index";</p> <p>$--color-primary: #409EFF; 全选代码 复制 然后在项目入口文件中引入: javascript import '@/styles/custom-theme.scss' API 调整 Element Plus 对部分组件的 API 进行了优化和改进。建议: ...