|
@@ -1,22 +1,40 @@
|
|
|
-// Note: Tailwind does not automatically escape font names.
|
|
|
-// If a font name contains an invalid identifier (like a space), we wrap it in quotes to escape the invalid characters.
|
|
|
-// Font stack optimised for built-in fonts of each major operating system, with support for emojis.
|
|
|
+/**
|
|
|
+ * # Typography
|
|
|
+ * Note: Tailwind does not automatically escape font names.
|
|
|
+ * If a font name contains an invalid identifier (like a space), we wrap it in quotes to escape the invalid characters.
|
|
|
+ */
|
|
|
|
|
|
+/**
|
|
|
+ * System UI Font stack for primary usage.
|
|
|
+ * Optimised for built-in fonts of each major operating system, with support for emojis.
|
|
|
+ */
|
|
|
const systemUIFontStack = [
|
|
|
+ // iOS Safari, macOS Safari, macOS Firefox
|
|
|
'-apple-system',
|
|
|
+ // macOS Chrome
|
|
|
'BlinkMacSystemFont',
|
|
|
+ // Windows - for all browsers on Windows 7+ (putting Segoe UI before system-ui ensures Segoe UI will be rendered for different languages)
|
|
|
'"Segoe UI"',
|
|
|
'system-ui',
|
|
|
+ // Targets Android and newer Chrome OS'. (If Roboto is installed on your windows computer Segoe UI will take precedence.)
|
|
|
'Roboto',
|
|
|
+ // A common fallback font for older macOS'
|
|
|
'"Helvetica Neue"',
|
|
|
+ // Very old Windows versions (special shout-out to whoever is using windows 95)
|
|
|
'Arial',
|
|
|
+ // A last resort if all else fails, just give us something without serifs :)
|
|
|
'sans-serif',
|
|
|
+ // All the emojis 👋🙂
|
|
|
'Apple Color Emoji',
|
|
|
'"Segoe UI Emoji"',
|
|
|
'"Segoe UI Symbol"',
|
|
|
'"Noto Color Emoji"',
|
|
|
];
|
|
|
|
|
|
+/**
|
|
|
+ * System UI Font stack for mono-space usage.
|
|
|
+ * Optimised for built-in fonts of each major operating system, with support for emojis.
|
|
|
+ */
|
|
|
const monoFontStack = [
|
|
|
// iOS Safari, MacOS Safari
|
|
|
'ui-monospace',
|
|
@@ -49,8 +67,10 @@ const fontFamily = {
|
|
|
mono: monoFontStack,
|
|
|
};
|
|
|
|
|
|
-// Key is equal to the pixel size of the rem value.
|
|
|
-// These values are used in combinations create typography defaults
|
|
|
+/**
|
|
|
+ * Key is equal to the pixel size of the rem value.
|
|
|
+ * These values are used in combinations create typography defaults
|
|
|
+ */
|
|
|
const fontSize = {
|
|
|
14: '0.875rem',
|
|
|
15: '0.9375rem',
|
|
@@ -70,7 +90,9 @@ const fontWeight = {
|
|
|
extrabold: 800,
|
|
|
};
|
|
|
|
|
|
-// These are set to ems to be relative to the font size
|
|
|
+/**
|
|
|
+ * These are set to ems to be relative to the font size.
|
|
|
+ */
|
|
|
const letterSpacing = {
|
|
|
tighter: '-0.05em',
|
|
|
tight: '-0.025em',
|