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

extract option fully implemented #90

Closed
hgl opened this issue Apr 6, 2015 · 3 comments
Closed

extract option fully implemented #90

hgl opened this issue Apr 6, 2015 · 3 comments

Comments

@hgl
Copy link
Contributor

hgl commented Apr 6, 2015

I have a fully implemented and tested cssnext fork in my extract branch that is able to this:

config.js

{
  "features": {
    "customProperties": {
      "variables": {
        "color": "#e00"
      }
    },
    "customMedia": {
      "extensions": {
        "mq2": "screen"
      }
    }
  }
}

style.css

:root {
    --width: calc(1px + 1px);
    --width2: var(--width);
}
@custom-media --mq (max-width: 30em);
cssnext --config config.js --extract style.css

=>

{
    "customProperties":{
        "width": "2px",
        "width2": "2px",
        "color": "#e00"
    },
    "customMedia":{
        "mq": "(max-width: 30em)",
        "mq2": "screen"
    }
}

From our previous discussion, you were worried the implementation will be a hack.

I just want to demonstrate it's not. I only added an append option to the custom properties and custom media plugin, which leaves js defined variable in the css source code.

Will you reconsider merging it? Comparing to defining variables in js, I think it's cleaner and easier to write.

@MoOx
Copy link
Owner

MoOx commented Jun 29, 2015

I think you have everything you want from the plugins currently used.

@hgl
Copy link
Contributor Author

hgl commented Jun 29, 2015

Yes, I will revise this PR soon. please consider merging csstools/postcss-custom-media#10

@MoOx
Copy link
Owner

MoOx commented Jan 8, 2016

Not sure it's relevant now. Feel free to reopen a PR if it is.

@MoOx MoOx closed this as completed Jan 8, 2016
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

2 participants