Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit f686a8d

Browse files
committed
chore: clean up extra indent for non-indentedSytax too
1 parent 97c9f16 commit f686a8d

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ module.exports = (css, settings) => {
1212

1313
// Prepend option data to cssWithPlaceholders
1414
const optionData = settings.sassOptions && settings.sassOptions.data || ''
15-
let data = optionData + '\n' + cssWithPlaceholders
16-
17-
// clean up extra indent if we are using indentedSyntax
18-
if(settings.sassOptions && settings.sassOptions.indentedSyntax) data = stripIndent(data)
15+
// clean up extra indent (indentedSyntax is not compatible with extra indenting)
16+
let data = stripIndent(optionData + '\n' + cssWithPlaceholders)
1917

2018
const preprocessed = sass
2119
.renderSync(Object.assign({}, settings.sassOptions, { data }))

test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ describe('styled-jsx-plugin-sass', () => {
167167
)
168168
})
169169

170-
it('cleans up extra indent with indentedSyntax', () => {
170+
it('cleans up extra indent', () => {
171171
assert.equal(
172172
plugin(`
173173
body

0 commit comments

Comments
 (0)