Skip to content

Commit 507da44

Browse files
committedJun 28, 2022
Update to modern SASS
1 parent c2775d1 commit 507da44

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed
 

‎HISTORY.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v2.0.0: 2022-06-28
4+
5+
- Move to modern SASS ([#25](https://github.com/jstransformers/jstransformer-scss/pull/25) by [@ispyhumanfly](https://github.com/ispyhumanfly))
6+
37
## v1.0.0: 2017-09-18
48

59
- Updated Boilerplate

‎index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict'
2-
31
const path = require('path')
42
const sass = require('sass')
53
const extend = require('extend-shallow')
@@ -9,6 +7,7 @@ exports.outputFormat = 'css'
97

108
exports.render = function (str, options) {
119
const input = extend({}, options, {data: str})
10+
// TODO: Replace with sass.compileString()
1211
const out = sass.renderSync(input)
1312
return {
1413
body: out.css.toString(),
@@ -21,6 +20,7 @@ exports.render = function (str, options) {
2120
exports.renderAsync = function (str, options) {
2221
const input = extend({}, options, {data: str})
2322
return new Promise((resolve, reject) => {
23+
// TODO: Replace with sass.compileStringAsync()
2424
sass.render(input, (err, out) => {
2525
if (err) {
2626
return reject(err)
@@ -40,6 +40,7 @@ exports.renderFile = function (filename, options) {
4040
const input = extend({}, options, {
4141
file: path.resolve(filename)
4242
})
43+
// TODO: Replace with sass.compile()
4344
const out = sass.renderSync(input)
4445
return {
4546
body: out.css.toString(),
@@ -54,6 +55,7 @@ exports.renderFile = function (filename, options) {
5455
exports.renderFileAsync = function (filename, options) {
5556
const input = extend({}, options, {file: path.resolve(filename)})
5657
return new Promise((resolve, reject) => {
58+
// TODO: Replace with sass.compileAsync()
5759
sass.render(input, (err, out) => {
5860
if (err) {
5961
return reject(err)

‎package.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"dependencies": {
33
"extend-shallow": "^3.0.2",
4-
"sass": "^1.24.4"
4+
"sass": "~1.53.0"
55
},
66
"name": "jstransformer-scss",
7-
"version": "1.0.0",
7+
"version": "2.0.0",
88
"description": "SCSS support for JSTransformers",
99
"keywords": [
1010
"jstransformer"
@@ -13,13 +13,12 @@
1313
"index.js"
1414
],
1515
"devDependencies": {
16-
"test-jstransformer": "^1.0.3",
16+
"test-jstransformer": "^1.1.0",
1717
"xo": "*"
1818
},
1919
"scripts": {
2020
"test": "test-jstransformer",
21-
"coverage": "test-jstransformer coverage",
22-
"posttest": "xo --space=2 --no-semicolon index.js"
21+
"coverage": "test-jstransformer coverage"
2322
},
2423
"engines": {
2524
"node": ">=4"

‎test/indentedSyntax/expected.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ nav li {
99
nav a {
1010
display: block;
1111
padding: 6px 12px;
12-
text-decoration: none;
12+
text-decoration: none;
1313
}

‎test/scss/expected.css

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
nav ul {
22
margin: 0;
33
padding: 0;
4-
list-style: none;
4+
list-style: none;
55
}
6-
76
nav li {
8-
display: inline-block;
7+
display: inline-block;
98
}
10-
119
nav a {
1210
display: block;
1311
padding: 6px 12px;
14-
text-decoration: none;
12+
text-decoration: none;
1513
}

0 commit comments

Comments
 (0)
Please sign in to comment.