Skip to content

Commit 196e0f4

Browse files
committed
Fix Chrome-specific emoji rendering issue
Chrome was rendering emojis in text/monochrome mode instead of color. Added Chrome-specific CSS properties to force color emoji presentation. Changes: - Added font-variant-emoji: emoji for Chrome - Added font-feature-settings fallback for older browsers - Applied to all headings, tables, and content areas This fixes the issue where ✅ ❌ render correctly in Firefox but not in Chrome.
1 parent 19bc167 commit 196e0f4

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

docs/.vitepress/theme/custom.css

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,22 @@ html:not(.dark) .diagram-light {
6767
}
6868
}
6969

70-
/* Ensure emojis render correctly with color and proper size */
71-
/* This fixes the issue where ✅ ❌ and other emojis show too small or without color */
72-
:root {
73-
/* Emoji font stack with color emoji support */
74-
--emoji-font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
75-
}
76-
77-
/* Apply emoji font to headings, tables, and general content */
70+
/* Fix Chrome emoji rendering - Chrome renders emojis as text/monochrome by default */
71+
/* Force color emoji presentation for Chrome and other browsers */
7872
h1, h2, h3, h4, h5, h6,
7973
p, li, td, th,
8074
.vp-doc {
81-
font-family: var(--vp-font-family-base), var(--emoji-font-family);
75+
/* Chrome-specific: force color emoji rendering */
76+
font-variant-emoji: emoji;
77+
/* Fallback for older browsers */
78+
-webkit-font-feature-settings: "emoji" 1;
79+
font-feature-settings: "emoji" 1;
8280
}
8381

84-
/* Ensure table emojis render at proper size */
82+
/* Ensure table cells render emojis properly in Chrome */
8583
table td, table th {
84+
font-variant-emoji: emoji;
8685
font-size: 1em;
87-
line-height: 1.5;
86+
line-height: 1.7;
87+
vertical-align: middle;
8888
}

0 commit comments

Comments
 (0)