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

Help: fill does not work when using @value to pass variables #49

Open
olabala opened this issue Dec 27, 2018 · 1 comment
Open

Help: fill does not work when using @value to pass variables #49

olabala opened this issue Dec 27, 2018 · 1 comment
Labels

Comments

@olabala
Copy link

olabala commented Dec 27, 2018

here is my css:

@value themeColor from 'index.css';

.icon {
  height: 1.45em;
  width: 1.45em;
  background: svg-load('back.svg', fill: themeColor) no-repeat left center;
  background-size: contain;
  padding-right: 0.36em;
  color: themeColor;
  cursor: pointer;
}

after rendering:

    height: 1.45em;
    width: 1.45em;
    background: url(data:image/svg+xml;charset=utf-8,%3C?xml version='1.0' encoding='UTF-8'?%3E…4.45,525.9 751.95,525.9 L328.35,525.9 Z' id='back'/%3E %3C/g%3E %3C/svg%3E) no-repeat left center;
    background-size: contain;
    padding-right: 0.36em;
    color: #ee4d2d;
    cursor: pointer;

fill failed to read variable themeColor's value, so i want to figure out if there are any wrong in my css code ???

@hudochenkov
Copy link
Collaborator

In your PostCSS plugins chain, plugin, which is replacing themeColor for it's actual value, should be running before postcss-inline-svg.

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

No branches or pull requests

2 participants