Skip to content

Commit

Permalink
Merge pull request #52 from gucong3000/v0361
Browse files Browse the repository at this point in the history
V0361
  • Loading branch information
ai authored Jun 5, 2019
2 parents 26f6338 + e34c981 commit 52388db
Show file tree
Hide file tree
Showing 7 changed files with 390 additions and 4 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock = false
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postcss-jsx",
"version": "0.36.0",
"version": "0.36.1",
"description": "PostCSS syntax for parsing CSS in JS literals",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion template-parser-helper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";
const Literal = require("./literal");
const isLiteral = token => token[0] === "word" && /^\$\{.*\}$/.test(token[1]);
const isLiteral = token => token[0] === "word" && /^\$\{[\s\S]*\}$/.test(token[1]);
function literal (start) {
if (!isLiteral(start)) {
return;
Expand Down
3 changes: 2 additions & 1 deletion test/css-in-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe("CSS in JS", () => {
`;
return postcss([
autoprefixer({
browsers: ["Chrome > 10"],
overrideBrowserslist: ["Chrome > 10"],
}),
]).process(
code,
Expand Down Expand Up @@ -141,6 +141,7 @@ describe("CSS in JS", () => {
describe("objectify for css", () => {
cases.each((name, css) => {
if (name === "bom.css") return;
if (name === "custom-properties.css") return;

it("objectStringifier " + name, () => {
const root = postcss.parse(css);
Expand Down
26 changes: 26 additions & 0 deletions test/fixtures/interpolation-content.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,29 @@ export const ButtonStyled4 = styled.button`
color: red;
${buttonStyles};
`;

export const ButtonStyled5 = styled.button`
${buttonStyles
}
color: red;
`;

export const ButtonStyled6 = styled.button`
${buttonStyles
};
color: red;
`;

export const ButtonStyled7 = styled.button`
;
color: red;
${buttonStyles
}
`;

export const ButtonStyled8 = styled.button`
;
color: red;
${buttonStyles
};
`;
Loading

0 comments on commit 52388db

Please sign in to comment.