element-plus / element-plus-nuxt-starter

🌰 A starter example for element-plus with Nuxt 3.
https://element-plus-nuxt.vercel.app
MIT License
289 stars 82 forks source link

Override SCSS variables doesn't work #52

Closed nphungthinh2601 closed 1 year ago

nphungthinh2601 commented 1 year ago

https://element-plus.org/en-US/guide/theming.html#by-scss-variables https://stackoverflow.com/questions/72512042/how-to-change-colors-of-a-tempa-element-plus-in-nuxt3 It doesn't work.

YunYouJun commented 1 year ago

Check example?

nphungthinh2601 commented 1 year ago

I have some code in ~/assets/scss/element-plus.scss

@forward 'element-plus/theme-chalk/src/common/var.scss' with ( $colors: ( 'primary': ( 'base': #ff8900, ), ) );

and nuxt.config.ts

css: ['~/assets/scss/element-plus.scss'], typescript: { strict: true, shim: false, }, // auto import components components: true,

vite: { plugins: [ Components({ resolvers: [ElementPlusResolver()], }), ], },

It look like ok but it doesn't work. I had tried clone your repo and override but it still doesn't work. Do you have any ideas on how I can improve the config file? Thanks a lot.

pheng0077 commented 1 year ago

Hello, is there any solution for that? I face the same problem too.