ProfessionalWiki / chameleon

Provides a highly flexible and customizable skin using Bootstrap 4
https://www.mediawiki.org/wiki/Skin:Chameleon
Other
116 stars 62 forks source link

SCSS compile error with scssphp/scssphp v1.7.0 #288

Closed mdoggydog closed 2 years ago

mdoggydog commented 2 years ago

With version 1.7.0 of scssphp/scssphp (released 18 hours ago, and I just happened to do a composer update 12 hours ago!), chameleon encounters SCSS compile errors. For example, fetching

load.php?lang=en&modules=ext.bootstrap.styles&skin=chameleon&debug=true

yields

/* SCSS compile error: $amount: Expected 30% to be within 0% and 1%: /srv/ctap-sunshinepps/Mediawiki/mediawiki/skins/chameleon/resources/styles/themes/_light.scss on line 128, at column 1\nCall Stack:\n#0 import /srv/mediawiki/skins/chameleon/resources/styles/themes/_light.scss (unknown file) on line 1*/

The scssphp/scssphp issue at https://github.com/scssphp/scssphp/issues/475 (opened and closed 7 hours ago) indicates that the use of percent units in scss functions is non-standard and no longer allowed by scssphp. E.g., fade_out($navbar-light-color, 30%) should be fade_out($navbar-light-color, 0.30) in chameleon/resources/styles/themes/_light.scss, and the same would apply to all uses of "%" in scss functions.

(I know next to nothing about SCSS; just reporting what I discovered in tracking this down. I have not actually tried changing _light.scss; I just pinned scssphp to 1.5.2 to get my own wiki working again.)

mdoggydog commented 2 years ago

FYI, the release notes for scssphp v1.7.0 include:

    ...
    Add spec-compliant validation of arguments in several color functions (@stof)
    ...
    Fix the handling of amounts in saturate(), desaturate(), fade-in() and fade-out() (@stof)
    ...
malberts commented 2 years ago

Thanks for the heads-up @mdoggydog

The newly released Chameleon 3.4.1 will fix this for percent units used within Chameleon. If you have any percent units in your own additional SCSS then you would have to fix that manually.

Perhaps we need to also make a release of Chameleon (and Bootstrap and SCSS) which locks everything to scssphp<1.7? And then bump the versions again to allow >=1.7? However, if nobody complains about their own SCSS being broken after this then I'm not going to do that.

mdoggydog commented 2 years ago

Thanks for the quick fix, @malberts . Chameleon 3.4.1 works over here (with both new scssphp 1.7.0 and the old 1.5.2, for what that's worth).