Skip to content

Commit c126495

Browse files
committed
[fixes css-modules#1] ah, adding nice string formatting needs the raws object now
1 parent d04c04d commit c126495

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ exports['default'] = function (css) {
9090
return _postcss2['default'].decl({
9191
value: definitions[key],
9292
prop: key,
93-
before: "\n ",
93+
raws: { before: "\n " },
9494
_autoprefixerDisabled: true
9595
});
9696
});
@@ -108,14 +108,14 @@ exports['default'] = function (css) {
108108

109109
css.prepend(_postcss2['default'].rule({
110110
selector: ':import(' + path + ')',
111-
after: "\n",
111+
raws: { after: "\n" },
112112
nodes: imports.map(function (_ref2) {
113113
var theirName = _ref2.theirName;
114114
var importedName = _ref2.importedName;
115115
return _postcss2['default'].decl({
116116
value: theirName,
117117
prop: importedName,
118-
before: "\n ",
118+
raws: { before: "\n " },
119119
_autoprefixerDisabled: true
120120
});
121121
})
@@ -126,7 +126,7 @@ exports['default'] = function (css) {
126126
if (exportDeclarations.length > 0) {
127127
css.prepend(_postcss2['default'].rule({
128128
selector: ':export',
129-
after: "\n",
129+
raws: { after: "\n" },
130130
nodes: exportDeclarations
131131
}));
132132
}

src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default css => {
5757
let exportDeclarations = Object.keys(definitions).map(key => postcss.decl({
5858
value: definitions[key],
5959
prop: key,
60-
before: "\n ",
60+
raws: { before: "\n " },
6161
_autoprefixerDisabled: true
6262
}))
6363

@@ -71,11 +71,11 @@ export default css => {
7171
importAliases.forEach(({path, imports}) => {
7272
css.prepend(postcss.rule({
7373
selector: `:import(${path})`,
74-
after: "\n",
74+
raws: { after: "\n" },
7575
nodes: imports.map(({theirName, importedName}) => postcss.decl({
7676
value: theirName,
7777
prop: importedName,
78-
before: "\n ",
78+
raws: { before: "\n " },
7979
_autoprefixerDisabled: true
8080
}))
8181
}))
@@ -85,7 +85,7 @@ export default css => {
8585
if (exportDeclarations.length > 0) {
8686
css.prepend(postcss.rule({
8787
selector: `:export`,
88-
after: "\n",
88+
raws: { after: "\n" },
8989
nodes: exportDeclarations
9090
}))
9191
}

0 commit comments

Comments
 (0)