ElemeFE / ElemeFE/element

[Feature Request] Move theme Scss variables to CSS variables

Open
#14,796 4 comments 13 reactions 0 assignees View on GitHub
stale
Dominant language
Vue
Stars
54k
Forks
14.4k
PR merge metrics
No merged PRs in 30d

Description

### Existing Component
Yes

### Component Name
All components inheriting styles from the theme.

### Description
It might be a good idea to move the Scss variables over to CSS variables.

We have a use case where we're using Element-UI as the _base_ for an internal component library. We allow custom theming via the `options` passed to `Vue.use(OurLibrary, ...)`, and the options passed in are then applied to CSS variables with `style.setProperty`.

Currently to be able to pass this theme onto any Element components, we're adding custom classnames to the relevant components, and then manually overriding the styles using the CSS variable. However this is getting painful as our library grows, as we have to check the full stylesheets of each Element UI component as we use them. As well as verifying there have been no classname changes each time we update the dependency.

If your theme variables were defined in CSS variables, it would mean any "level" could easily adjust them. Be that in:
1) A library consuming Element UI
2) An application consuming a library that consumes Element UI
3) Anything further up the stack, I think you get the gist...

I'd be willing to lend a hand on this 🙂

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.