Skip to content

Commit

Permalink
feat: custom element-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Faizal Andyka committed Jun 11, 2021
1 parent 6991f68 commit 213a4a2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ import store from './store'
import router from './router'
import locales from './locales'

import './styles/vendors/tailwind.scss'
import './styles/vendors/nprogress.scss'
import './styles/index.scss'

createApp(app)
.use(store)
.use(router)
Expand Down
4 changes: 4 additions & 0 deletions src/styles/vendors/element.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// tailwind colors
$--color-primary: #3b82f6;

@use 'element-plus/packages/theme-chalk/src/common/transition.scss';
18 changes: 16 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ export default defineConfig(({ mode }) => {
libraryName: 'element-plus',
esModule: true,
ensureStyleFile: true,
resolveStyle: (name) => {
resolveStyle: (name: string) => {
name = name.slice(3)
return `element-plus/packages/theme-chalk/src/${name}.scss`
},
resolveComponent: (name) => {
resolveComponent: (name: string) => {
return `element-plus/lib/${name}`
}
}]
Expand Down Expand Up @@ -142,6 +142,20 @@ export default defineConfig(({ mode }) => {
build,
plugins,
optimizeDeps,

css: {
preprocessorOptions: {
scss: {
additionalData: `
@import "@/styles/vendors/element.scss";
@import "@/styles/vendors/tailwind.scss";
@import "@/styles/vendors/nprogress.scss";
@import "@/styles/index.scss";
`
}
}
},

resolve: {
alias: [
{
Expand Down

0 comments on commit 213a4a2

Please sign in to comment.