Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

推荐将sass的@import都改为官方推荐的@use #161

Open
yeyunwen opened this issue Feb 15, 2024 · 2 comments
Open

推荐将sass的@import都改为官方推荐的@use #161

yeyunwen opened this issue Feb 15, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@yeyunwen
Copy link

sass的@import实现的模块化有以下缺陷:

  1. 容易混淆。 需区分css 的运行时的模块化,还是 sass 的编译时的模块化。
  2. 污染。 如果导入的多个模块中有相同的属性,那么最后一个会覆盖前面的。
  3. 无私有属性。
  4. 可能生成多次代码。

element-plus的源码中sass模块导入均使用@use

推荐将@import全部改成sass官方推荐的@use。规避以上问题,同时让数据来源更加清晰。

@pany-ang pany-ang added the enhancement New feature or request label Feb 20, 2024
@Aaron-zon
Copy link
Contributor

目前其他部分还好,但是theme部分改为@use感觉会很复杂而且繁琐。

@pany-ang
Copy link
Member

pany-ang commented Apr 30, 2024

将在该 PR:#188 完成后开始迁移至 @use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants