mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
chore: migrate api node-sass
to dart-sass
https://sass-lang.com/documentation/js-api/#md:legacy-api
This commit is contained in:
parent
7bd61f2c96
commit
7714b7fbd9
@ -81,10 +81,7 @@ while((match = ruleRegex.exec(colorsFile)) !== null) {
|
|||||||
await fs.copy(path.join(__dirname,"../packages/node_modules/@node-red/editor-client/src/sass/"),workingDir)
|
await fs.copy(path.join(__dirname,"../packages/node_modules/@node-red/editor-client/src/sass/"),workingDir)
|
||||||
await fs.writeFile(path.join(workingDir,"colors.scss"),updatedColors.join("\n"))
|
await fs.writeFile(path.join(workingDir,"colors.scss"),updatedColors.join("\n"))
|
||||||
|
|
||||||
const result = sass.renderSync({
|
const result = sass.compile(path.join(workingDir, "style-custom-theme.scss"), {style: "expanded"});
|
||||||
outputStyle: "expanded",
|
|
||||||
file: path.join(workingDir,"style-custom-theme.scss"),
|
|
||||||
});
|
|
||||||
|
|
||||||
const css = result.css.toString()
|
const css = result.css.toString()
|
||||||
const lines = css.split("\n");
|
const lines = css.split("\n");
|
||||||
@ -119,7 +116,7 @@ while((match = ruleRegex.exec(colorsFile)) !== null) {
|
|||||||
* Theme generated with Node-RED ${nrPkg.version} on ${now}
|
* Theme generated with Node-RED ${nrPkg.version} on ${now}
|
||||||
*/`;
|
*/`;
|
||||||
|
|
||||||
var output = sass.renderSync({outputStyle: parsedArgs.long?"expanded":"compressed",data:colorCSS.join("\n")});
|
const output = sass.compileString(colorCSS.join("\n"), {style: parsedArgs.long ? "expanded" : "compressed"});
|
||||||
if (parsedArgs.out) {
|
if (parsedArgs.out) {
|
||||||
|
|
||||||
await fs.writeFile(parsedArgs.out,header+"\n"+output.css);
|
await fs.writeFile(parsedArgs.out,header+"\n"+output.css);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user