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

Global variables not being complied in dist #93

Closed
nicolemors opened this issue Feb 4, 2017 · 5 comments
Closed

Global variables not being complied in dist #93

nicolemors opened this issue Feb 4, 2017 · 5 comments

Comments

@nicolemors
Copy link
Contributor

I am pretty sure this is an issue with postcss-cssnext... but I can't figure it out. I even tried their glitter chat.

I am using Drizzle for a project and variables just stopped working, I also downloaded a fresh instance of Drizzle and I had the same issue 😑 :
no-variables

When I comment out @use postcss-cssnext; its business as usual, but no cssnext goodness 😑 :
no-cssnext

@erikjung
Copy link
Contributor

erikjung commented Feb 4, 2017

I am using Drizzle for a project and variables just stopped working

@nicolemors Can you expand on that a bit? PostCSS uses this plugin to handle custom properties: https://github.com/postcss/postcss-custom-properties

The expected output would not have your :root definitions in it (unless you configured the plugin using the preserve option). The main function of the plugin is to replace the property references with their corresponding values:

Input

:root {
  --myColor: red;
}

body {
  color: var(--myColor);
}

Output

body {
  color: red;
}

If you add color(--color-red) to your html selector, what shows up in the output?

This?

html {
  color: #ff4136;
  line-height: 1.5;
}

or this?

html {
  color: color(--color-red);
  line-height: 1.5;
}

@nicolemors nicolemors reopened this Feb 4, 2017
@nicolemors
Copy link
Contributor Author

Okay, I guess my real problem is that it's not watching/running when I make changes. The variables are actually converting, but I have to manually run gulp to see any changes I am making.
PS: thanks for a speedy reply... on saturday

@nicolemors
Copy link
Contributor Author

I figured this out! Closing this issue.

@tylersticka
Copy link
Member

I figured this out! Closing this issue.

@nicolemors What was it, out of curiosity?

@nicolemors
Copy link
Contributor Author

I ran updates on my machine, I ended up just using my werk machine which I had not updated yet... ooooh apple thanks for wasting my day.

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

No branches or pull requests

3 participants