Use native system fonts on Android and iOS

This behavior is called for in the new designs, but Compound Web doesn't (yet) implement it by default.
This commit is contained in:
Robin
2023-09-17 12:54:18 -04:00
parent c481d3c908
commit 9736f0244b
4 changed files with 57 additions and 23 deletions

View File

@@ -25,12 +25,6 @@ limitations under the License.
@import "@vector-im/compound-web/dist/style.css";
:root {
--font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
"Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
"Helvetica Neue", sans-serif;
--inter-unicode-range: U+0000-20e2, U+20e4-23ce, U+23d0-24c1, U+24c3-259f,
U+25c2-2664, U+2666-2763, U+2765-2b05, U+2b07-2b1b, U+2b1d-10FFFF;
--font-scale: 1;
--font-size-micro: calc(10px * var(--font-scale));
--font-size-caption: calc(12px * var(--font-scale));
@@ -149,7 +143,6 @@ body {
color: var(--cpd-color-text-primary);
color-scheme: dark;
margin: 0;
font-family: var(--font-family);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@@ -165,6 +158,19 @@ body,
flex-direction: column;
}
/* On Android and iOS, prefer native system fonts */
body[data-platform="android"] {
--cpd-font-family-sans: "Roboto", "Noto", "Inter", sans-serif;
}
body[data-platform="ios"] {
--cpd-font-family-sans: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
}
body[data-platform="desktop"] {
--cpd-font-family-sans: "Inter", sans-serif;
}
h1,
h2,
h3,