File tree Expand file tree Collapse file tree 3 files changed +23
-3
lines changed
Expand file tree Collapse file tree 3 files changed +23
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @cloudfour/patterns ' : patch
3+ ---
4+
5+ Prevent WordPress from overriding the "small" font size utility styles.
Original file line number Diff line number Diff line change 1717/// To prevent small text from impairing readability (most importantly) and our
1818/// Core Web Vitals (secondarily), we only apply the small font size if it isn't
1919/// smaller than 16 pixels.
20- @mixin small {
21- font-size : max (16px , size .$font-small );
20+ ///
21+ /// @param {Boolean} $important - Whether or not to output the rule with an
22+ /// `!important` flag. Added to satisfy WordPress 5.9+.
23+ /// @link https://make.wordpress.org/core/2022/01/08/updates-for-settings-styles-and-theme-json/
24+ @mixin small ($important : false) {
25+ @if $important {
26+ font-size : max (16px , size .$font-small ) !important ;
27+ } @else {
28+ font-size : max (16px , size .$font-small );
29+ }
2230}
Original file line number Diff line number Diff line change @@ -82,8 +82,15 @@ $color-map: meta.module-variables('color-base');
8282 @include font-size .big ;
8383}
8484
85+ /// We need to use `!important` because otherwise WordPress will override this
86+ /// size as of version 5.9. We could get around this by setting the font size
87+ /// via `theme.json`, but that would make this an outlier among our other sizes,
88+ /// so for now we'll just use `!important`.
89+ ///
90+ /// @link https://make.wordpress.org/core/2022/01/08/updates-for-settings-styles-and-theme-json/
91+
8592.has-small-font-size {
86- @include font-size .small ;
93+ @include font-size .small ( $important : true) ;
8794}
8895
8996@for $level from -2 through 3 {
You can’t perform that action at this time.
0 commit comments