-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(skinStyles): add Math skinStyles (#502)
* Create Extension:Math styles * Added ext.math.styles * Added Extension:Math as Grade E I'm not sure how to accomplish this without using LESS variables. CSS variables don't seem to work with the `.recolor()` mixin. * Added Stack Overflow link
- Loading branch information
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Citizen | ||
* | ||
* SkinStyles for Extension:Math | ||
* Module: ext.math.styles | ||
* Version: REL1_35 b7a7939 | ||
* | ||
* Date: 2022-08-16 | ||
*/ | ||
|
||
@import '../../../resources/variables.less'; | ||
|
||
// From https://stackoverflow.com/a/73390109/10624167 | ||
.recolor(@color: #333) { | ||
@r: red(@color) / 255; | ||
@g: green(@color) / 255; | ||
@b: blue(@color) / 255; | ||
@a: alpha(@color); | ||
|
||
// grayscale fallback if SVG from data url is not supported | ||
@lightness: lightness(@color); | ||
filter: saturate(0%) brightness(0%) invert(@lightness) opacity(@a); | ||
|
||
// color filter | ||
@svg-filter-id: "recolor"; | ||
filter: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"><filter id="@{svg-filter-id}" color-interpolation-filters="sRGB"><feColorMatrix type="matrix" values="0 0 0 0 @{r} 0 0 0 0 @{g} 0 0 0 0 @{b} 0 0 0 @{a} 0"/></filter></svg> #@{svg-filter-id}'); | ||
} | ||
|
||
.skin-citizen-light { | ||
.mwe-math-fallback-image-display, | ||
.mwe-math-fallback-image-inline { | ||
.recolor(@color-base); | ||
} | ||
} | ||
|
||
.skin-citizen-dark { | ||
.mwe-math-fallback-image-display, | ||
.mwe-math-fallback-image-inline { | ||
.recolor(@dark-color-base); | ||
} | ||
} |