Skip to content

Node.js based forum software built for the modern web

fix: rtlcss ignore directives were stripped before rtl processing (#14907)

palmoni5ac21ac7876da
diff --git a/src/meta/minifier.js b/src/meta/minifier.js
index 6c83ddd86a..7cfa86d1d3 100644
--- a/src/meta/minifier.js
+++ b/src/meta/minifier.js
@@ -223,7 +223,6 @@ actions.buildCSS = async function buildCSS(data) {
importers: [new sass.NodePackageImporter()],
};
if (data.minify) {
- opts.style = 'compressed';
opts.silenceDeprecations = [
'legacy-js-api', 'color-functions',
'global-builtin', 'import', 'if-function',
@@ -237,15 +236,18 @@ actions.buildCSS = async function buildCSS(data) {
async function processScss(direction) {
- if (direction === 'rtl') {
- css = await postcss([rtlcss()]).process(css, {
- from: undefined,
- });
- }
- const postcssArgs = [autoprefixer];
- return await postcss(postcssArgs).process(css, {
+ const postcssArgs = direction === 'rtl' ? [rtlcss(), autoprefixer] : [autoprefixer];
+ const result = await postcss(postcssArgs).process(css, {
from: undefined,
});
+ if (!data.minify) {
+ return result;
+ }
+ const minified = await sass.compileStringAsync(result.css, {
+ syntax: 'css',
+ style: 'compressed',
+ });
+ return { css: minified.css };
}
const [ltrresult, rtlresult] = await Promise.all([