Fix missusage of Sass rgba global function #159
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The value used for the alpha channel in the global rgba Sass function is wrong, which ends up producing the rgb color instead.
According to the documentation
To fix it, we can either: add the missing%
or change the value to its equivalent unitless number between 0 and 1. The first option was chosen.But using a good value does not work either because it produces a CSS rgba function with a unitless alpha value. I.e., both
rgba(255, 255, 255, 0.6)
andrgba(255, 255, 255, 60%)
Sass built-in functions producergba(255, 255, 255, 0.6)
CSS function.However, as @lslezak mentioned in IRC channel, Qt expect a percentage between 0 and 100 for the alpha channel value in the rgba function. A complete mess 🤷♂️
So, the (poor man) solution is to interpolate the full rgba function to produce the value expected for Qt. Maybe we could create a Sass user function to do so, but for now it is enough as it is.
Tests (updated with the latest fix)
Tested manually in the first screen of the installer, which holds a disabled
Back
QPushButton.It works.
Screenshots (updated with the latest fix)