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
When in production mode, the @import statements are ignored #205
Comments
This looks like a difficult problem to solve. You're right the import statement needs to be at the top of the file. I'm not foo familiar with how MediaWiki assembles the final CSS file, but the problem is that it's combining multiple CSS files and that would require some additional processing to move all the imports to the top. The SCSS compiler will produce a CSS file with everything in the right order, which is why it works correctly in debug mode, but once combined your import is out of order. MW is basically combining raw CSS, LESS compiler CSS and SASS compiler CSS. At this point you could now have a few separate CSS files with imports, so it's no longer just as simple as moving one CSS file to the top when combining them. I would argue that's a MW problem then to make sure that the combined CSS is valid. However, since that doesn't immediately solve the problem, here are some Chameleon workarounds ideas:
I'll also dig a little deeper into how the resource loader works to see if there is another way, but I think that is maybe too much work right now since there is a usable workaround (Common.css). |
I've opened a issue for the ResourceLoader team. Let's hope they can do something about it ? https://phabricator.wikimedia.org/T284629 |
Hello, I'm pretty sure this is not a Chameleon specific issue, but maybe someone here would be able to lead me to the correct place...
I have a SCSS file with an import statement at the top (Google font). It works well while the
$wgResourceLoaderDebug = true;
is set. In production environment however, the @import statement gets lost in the middle of all concatenated and minimized css, and therefore is ignored (apparently, an import statement must come first, before any css rule in the CSS file).I tried playing with the position (beforeFunctions) but could not find one that would put the import statement at the top.
The only workaround was to put it in the Mediawiki:Common.css, which works, lucklily.
Thanks for any input about that!
The text was updated successfully, but these errors were encountered: