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

inline !important styles don't get added #1834

Closed
1u0n opened this issue Nov 2, 2018 · 3 comments · Fixed by #3435
Closed

inline !important styles don't get added #1834

1u0n opened this issue Nov 2, 2018 · 3 comments · Fixed by #3435
Labels

Comments

@1u0n
Copy link

1u0n commented Nov 2, 2018

I'm using svelte 2.15.0

if my template has inline !important styles like

<div style="margin:10px !important"></div>

the compiler will create setStyle(node, 'margin', '10px !important')

which in the end executes node.style.setProperty('margin', '10px !important')

This fails silently and margin attribute doesn't get added, because setProperty expects !important attributes to be added with a flag like this: node.style.setProperty('margin', '10px', 'important')

@kaisermann
Copy link
Member

Inline styles don't need !important, since they already override every other css definition for that specific element 🤔

@gavinmcfarland
Copy link

True, apart from if you were trying to use !important to override !important. Probably a sign something's amiss though of you're doing that.

@Rich-Harris
Copy link
Member

Finally fixed, in 3.9.1 — thanks

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

Successfully merging a pull request may close this issue.

5 participants