Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

Alternative to Verbose CSS variables #7

Open
d3dc opened this issue Dec 11, 2019 · 1 comment
Open

Alternative to Verbose CSS variables #7

d3dc opened this issue Dec 11, 2019 · 1 comment

Comments

@d3dc
Copy link

d3dc commented Dec 11, 2019

It seems like there's an ongoing discussion on this so this issue might be redundant in the scope of things.

I guess the reason for the verbose naming is to avoid collision with the user's defined values and have a global "theme". If I have a one-off Card or similar, its a lot of typing --Card- in the style attribute.

It might be convenient to expose Component-level CSS variables as props just for that reason:

<script>
  export let borderRadius
</script>

<div style="--Card-border-radius: {borderRadius}">
</div>

edit: Hadn't seen sveltejs/rfcs#13 yet...

@rob-balfre
Copy link
Member

@d3dc yeah jury is still out on how we are gonna handle CSS vars. Will keep this open...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants