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

Custom media feature in combination with @import #86

Closed
carlcs opened this issue Jul 3, 2014 · 3 comments
Closed

Custom media feature in combination with @import #86

carlcs opened this issue Jul 3, 2014 · 3 comments

Comments

@carlcs
Copy link

carlcs commented Jul 3, 2014

I encounter an error when I @import a file that makes use of the new "custom media" feature.

Warning: Cannot read property 'start' of undefined`

Using the breakpoint alias in the same file works though:

@custom-media --lg-viewport screen and (min-width: 64em);

@media (--lg-viewport) {
  /* styles for large viewport */
}
@carlcs
Copy link
Author

carlcs commented Jul 4, 2014

Example: Define a breakpoint in a separate CSS file than the actual component that makes use of the breakpoint alias. Then @import the component:

@custom-media --lg-viewport screen and (min-width: 64em);
@import "Component-lg.css";

'Component-lg.css' that calls the breakpoint alias:

@media (--lg-viewport) {
  /* styles for large viewport */
}

@MoOx
Copy link
Contributor

MoOx commented Jul 4, 2014

This is due to rework-import that where parsing imported files using an outdated parser.
It's fixed in master by b63cede
FYI reworkcss/rework#172

@carlcs
Copy link
Author

carlcs commented Jul 4, 2014

👍

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

No branches or pull requests

2 participants