Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Define variables in media-dependent @import #58

Open
carlcs opened this issue May 8, 2014 · 5 comments
Open

Define variables in media-dependent @import #58

carlcs opened this issue May 8, 2014 · 5 comments

Comments

@carlcs
Copy link

carlcs commented May 8, 2014

New @import support is working great, but not if I add media queries to it. Variables defined within a imported CSS-file are then being ignored.

Example import.css

/* Basic import */
@import "import.include-sm.css";

/* Media-dependent import */
@import "import.include-lg.css" (min-width: 64em);

import.include-sm.css

:root {
  --font-size: 2em;
}
.Section {
  font-size: var(--font-size);
}

import.include-lg.css

:root {
  --font-size: 3em;
}
.Section {
  font-size: var(--font-size);
}

import.out.css

/* Basic import */
.Section {
  font-size: 2em;
}

/* Media-dependent import */
@media (min-width: 64em) {
  :root {
    --font-size: 3em;
  }
  .Section {
    font-size: 2em;
  }
}
@MoOx
Copy link
Contributor

MoOx commented Jun 14, 2014

This is probably due the standard rework-vars limitation. Maybe you should report this issue over there.

@carlcs
Copy link
Author

carlcs commented Jun 21, 2014

@MoOx already moved this to the right place. Closing

@carlcs carlcs closed this as completed Jun 21, 2014
@MoOx
Copy link
Contributor

MoOx commented Jun 22, 2014

Maybe we should keep this open until we update appropriate dependency here ?

@carlcs carlcs reopened this Jun 22, 2014
@ianstormtaylor
Copy link
Contributor

@MoOx is this something we should close? Is it the variables inside media limitation?

@MoOx
Copy link
Contributor

MoOx commented Mar 28, 2015

See that by your self postcss/postcss-custom-properties#9

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

No branches or pull requests

3 participants