diff --git a/projects/packages/jetpack-mu-wpcom/changelog/mu-wpcom-font-smoothing b/projects/packages/jetpack-mu-wpcom/changelog/mu-wpcom-font-smoothing new file mode 100644 index 0000000000000..7494744a3a342 --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/changelog/mu-wpcom-font-smoothing @@ -0,0 +1,4 @@ +Significance: minor +Type: added + +MU WPCOM: Port font-smoothing-antialiased feature from ETK diff --git a/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php b/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php index c2bd93c73f499..29ca5aea734ce 100644 --- a/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php +++ b/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php @@ -85,6 +85,7 @@ public static function load_features() { require_once __DIR__ . '/features/cloudflare-analytics/cloudflare-analytics.php'; require_once __DIR__ . '/features/error-reporting/error-reporting.php'; require_once __DIR__ . '/features/first-posts-stream/first-posts-stream-helpers.php'; + require_once __DIR__ . '/features/font-smoothing-antialiased/font-smoothing-antialiased.php'; // To avoid potential collisions with ETK. if ( ! class_exists( 'A8C\FSE\Help_Center' ) ) { require_once __DIR__ . '/features/help-center/class-help-center.php'; diff --git a/projects/packages/jetpack-mu-wpcom/src/features/font-smoothing-antialiased/font-smoothing-antialiased.css b/projects/packages/jetpack-mu-wpcom/src/features/font-smoothing-antialiased/font-smoothing-antialiased.css new file mode 100644 index 0000000000000..7149796a6dc6f --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/src/features/font-smoothing-antialiased/font-smoothing-antialiased.css @@ -0,0 +1,10 @@ +@media (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi) { + body.font-smoothing-antialiased, + /** Overriding an existing core WP rule so the ID selector is necessary */ + body.font-smoothing-antialiased #wpwrap, + body.font-smoothing-antialiased #wpadminbar * { + text-rendering: optimizeLegibility; + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + } +} diff --git a/projects/packages/jetpack-mu-wpcom/src/features/font-smoothing-antialiased/font-smoothing-antialiased.php b/projects/packages/jetpack-mu-wpcom/src/features/font-smoothing-antialiased/font-smoothing-antialiased.php new file mode 100644 index 0000000000000..7499e0e48fcdf --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/src/features/font-smoothing-antialiased/font-smoothing-antialiased.php @@ -0,0 +1,36 @@ +