-
Notifications
You must be signed in to change notification settings - Fork 918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace node-sass
with sass-embedded
#5338
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ | |
"del": "^6.1.1", | ||
"getopts": "^2.2.5", | ||
"pegjs": "0.10.0", | ||
"sass-loader": "npm:@amoo-miki/sass-loader@10.4.1-node-sass-9.0.0-libsass-3.6.5", | ||
"sass-loader": "npm:@amoo-miki/sass-loader@10.4.1-node-sass-9.0.0-libsass-3.6.5-with-sass-embedded.rc1", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we have a followup task to update this to a "released" version of your patch, rather than an rc tag? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The only reason I used rc was to discourage the use of it by others as i noticed some of my other patches were being used. |
||
"style-loader": "^1.1.3", | ||
"supports-color": "^7.0.0", | ||
"url-loader": "^2.2.0", | ||
|
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
*/ | ||
|
||
const { strip } = require('comment-stripper'); | ||
const sass = require('node-sass'); | ||
const sass = require('sass-embedded'); | ||
const postcss = require('postcss'); | ||
const postcssConfig = require('@osd/optimizer/postcss.config.js'); | ||
|
||
|
@@ -70,6 +70,26 @@ module.exports = function (grunt) { | |
|
||
grunt.registerTask('prodBuild', ['clean:target', 'copy:makeProdBuild', 'babel:prodBuild']); | ||
|
||
const uiFrameworkCompile = async (src, dest) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ugh, I can't wait to get rid of this whole package... |
||
try { | ||
const { css: compiledCSS } = await sass.compileAsync(src); | ||
const result = await postcss([postcssConfig]).process( | ||
strip(compiledCSS, { language: 'css' }), | ||
{ | ||
from: src, | ||
to: dest, | ||
} | ||
); | ||
|
||
grunt.file.write(dest, result.css); | ||
if (result.map) { | ||
grunt.file.write(`${dest}.map`, result.map); | ||
} | ||
} catch (ex) { | ||
grunt.log.error(ex); | ||
} | ||
}; | ||
|
||
grunt.registerTask('compileCss', function () { | ||
const done = this.async(); | ||
Promise.all([ | ||
|
@@ -79,34 +99,4 @@ module.exports = function (grunt) { | |
uiFrameworkCompile('src/kui_next_dark.scss', 'dist/kui_next_dark.css'), | ||
]).then(done); | ||
}); | ||
|
||
function uiFrameworkCompile(src, dest) { | ||
return new Promise((resolve) => { | ||
sass.render( | ||
{ | ||
file: src, | ||
}, | ||
function (error, result) { | ||
if (error) { | ||
grunt.log.error(error); | ||
} | ||
|
||
postcss([postcssConfig]) | ||
.process(strip(result.css.toString('utf8'), { language: 'css' }), { | ||
from: src, | ||
to: dest, | ||
}) | ||
.then((result) => { | ||
grunt.file.write(dest, result.css); | ||
|
||
if (result.map) { | ||
grunt.file.write(`${dest}.map`, result.map); | ||
} | ||
|
||
resolve(); | ||
}); | ||
} | ||
); | ||
}); | ||
} | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
text-align: center; | ||
background-color: $euiColorEmptyShade; | ||
border-radius: 100%; | ||
padding: $euiSize / 2; | ||
padding: calc($euiSize / 2); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the changes above, do we have to add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's just for division operations - see https://sass-lang.com/documentation/breaking-changes/slash-div/ |
||
|
||
.euiIcon { | ||
vertical-align: baseline; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can workflow files take comments? An explanation here might be helpful for if/when GitHub improves their Windows infra and we can remove these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am pretty sure they can. i will add something.