Element: [Bug Report] When under dev mode and customize theme with scss variables, el-button's styles will be imported multiple times

Created on 21 Nov 2017  ·  4Comments  ·  Source: ElemeFE/element

Element UI version

2.0.5

OS/Browsers version

Mac OS 10.12.6 / Chrome 62.0.3202.94

Vue version

2.5.7

Reproduction Link

https://jsfiddle.net/

Steps to reproduce

just define custom variables and import original element-ui styles:

@import '_element-variables';

@import './node_modules/element-ui/packages/theme-chalk/src/index';

What is Expected?

el-button's styles should be imported only once

What is actually happening?

el-button's styles are imported multiple times

From Element-UI source code: index.scss will import button.scss, but some components will also import button.scss (for example: dropdown.scss, message-box.scss ...), cause so.

Most helpful comment

muitiple_styles

All 4 comments

muitiple_styles

Same here.

Some of the components are mutually dependent, so this seems inevitable. And in production all duplicated styles will be removed.

@Leopoldthecoder Maybe it's a design problem... and it's still a bug.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

makunsusu picture makunsusu  ·  3Comments

FranzSkuffka picture FranzSkuffka  ·  3Comments

zhguokai picture zhguokai  ·  3Comments

yorululu picture yorululu  ·  3Comments

yuchonghua picture yuchonghua  ·  3Comments