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

Importing values results in export #79

Open
okonet opened this issue Nov 30, 2016 · 2 comments
Open

Importing values results in export #79

okonet opened this issue Nov 30, 2016 · 2 comments

Comments

@okonet
Copy link

okonet commented Nov 30, 2016

Having variables in the separate file

/* variables.css */
@value mobile: 480px;
@value tablet: 768px;
@value desktop: 960px;
@value display: 1200px;

and when importing like this:

/* myfile.css */
@value mobile, display from "../variables.css";

.root {
...
}

and then

import styles from '.myfile.css';
console.log(styles);

I see that styles now contain imported variables.

{
  root: "some_hash",
  mobile: "480px",
  display: "1200px"
}

I'm not sure if this is expected behavior but I'd expect this behavior only from variables.css.

@joeybaker
Copy link

Is there a reason you'd not want this? It seems to me that since you've imported the values into your CSS file, you might want them in the JS file too, no?

@okonet
Copy link
Author

okonet commented Nov 30, 2016

The only reason is that there is no difference between my class names and variables in this object.

I'm doing some dynamic classNames matching depending on my props and was seeing that my elements got additional classNames (mobile and display). This could probably be fixed in the matching function but I was wondering if this is how it suppose to work.

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

No branches or pull requests

3 participants