Skip to content

Commit

Permalink
fix: css`` tagged template strings (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriellsh committed Jun 10, 2020
1 parent de715db commit 3b655a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/css-in-js/src/tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const createReplacementsMapping = (rules = []) => (value) => {
*/
export const css = (slices: TemplateStringsArray, ...values: string[]): cssFn => (rules: string[] = []) => {
const replacements = values.map(createReplacementsMapping(rules));
return String.raw(slices, ...replacements);
return Array.from({ length: slices.length + replacements.length }, (_, i) => (i - (i % 2)) / 2).map((j, i) => (i % 2 === 0 ? slices[j] : replacements[j])).join('');
};

/**
Expand Down

0 comments on commit 3b655a4

Please sign in to comment.