-
Notifications
You must be signed in to change notification settings - Fork 18
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
Syntax weirdness? #20
Comments
I'm also getting build errors when trying this: @value vars: styles/variables.css;
.myList {
composes: abs-pos from vars;
} Instead, it only works with this syntax. .myList {
composes: abs-pos from "styles/variables.css";
} |
Yeah that final example I think would have to be: @value vars: styles/variables.css;
.myList {
composes: abs-post from "vars";
} Which makes me sad. I'm thinking that a rule of no quotes in values definitions (see #23) makes sense, but with special handling for replacements within |
@bclinkinbeard I am also seeing the issue you describe with this syntax:
This produces a build error of It's a shame, because this is the syntax presented as an example on the postcss-modules-values project README, and I imagine quite a few folks being mystified when it doesn't work. |
Any update on this? Running into the same issue as @dspnorman. Is the README incorrect, or our implementation? |
I think the README is wrong. I was also trying for 2-3 hours trying to get this "composes: xxx from yyy" to work, but gave up. Now I see that I was doing it wrong 😄 |
I also ran into this. The README is misleading. My error:
|
This could be my fault, but if it's not then it's probably worth addressing.
Use case 1: If the first line of
styles.css
is written with quotes around the file name, like@value vars: "styles/variables.css;"
, then the value ofstyles.vars
in JS is""styles/variables.css""
; a string that includes the quote marks. I'm not sure if the README just needs to be updated to remove the quotes or if this is a bug.Use case 2: If quotes are omitted when getting a value directly (
@value thing from "styles/variables.css";
) the rest of the line is interpreted literally, resulting in the value ofstyles.thing
being"from styles/variables.css"
. Maybe this is related to the colon being optional?Basically, it seems odd to require the omission of quotes in Use Case 1 and require the inclusion of quotes in Use Case 2. They're doing nearly the same thing, so I'd expect a consistent syntax.
Is this intended, a bug, or something I'm doing wrong?
The text was updated successfully, but these errors were encountered: