mirror of
https://github.com/MoonshotAI/kimi-code.git
synced 2026-07-09 17:29:12 +00:00
fix(kimi-web): disable text hyphenation and code ligatures (#1438)
Set hyphens: none (with the -webkit- prefix) on body so chat and markdown text never gain a hyphen glyph at a line break; components still control where lines wrap via word-break/overflow-wrap. Disable the ligatures that coding fonts enable by default (liga/calt/ss01) on native code elements so code renders literally, e.g. != stays as two characters.
This commit is contained in:
parent
0824e7b668
commit
d86fa38e11
2 changed files with 20 additions and 0 deletions
5
.changeset/web-text-rendering.md
Normal file
5
.changeset/web-text-rendering.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@moonshot-ai/kimi-code": patch
|
||||
---
|
||||
|
||||
web: Prevent chat text from hyphenating at line breaks and render code without font ligatures.
|
||||
|
|
@ -223,6 +223,17 @@ summary {
|
|||
vertical-align: -0.15em;
|
||||
}
|
||||
|
||||
/* Render code literally: disable the ligatures coding fonts enable by default
|
||||
(e.g. `!=` collapsing to `≠`, `=>` to `⇒`). */
|
||||
code,
|
||||
pre,
|
||||
kbd,
|
||||
samp,
|
||||
tt {
|
||||
font-feature-settings: "liga" 0, "calt" 0, "ss01" 0;
|
||||
font-variant-ligatures: none;
|
||||
}
|
||||
|
||||
/* color-scheme drives UA-rendered parts (scrollbars, form controls, etc.).
|
||||
An explicit choice must pin it to a single value — otherwise a dark-mode
|
||||
user on a light OS gets light scrollbars floating on the dark UI. */
|
||||
|
|
@ -635,6 +646,10 @@ body {
|
|||
text-rendering: auto;
|
||||
font-synthesis: none;
|
||||
text-size-adjust: 100%;
|
||||
/* Never insert a hyphen glyph at line breaks (the page is `lang="en"`);
|
||||
word-break/overflow-wrap still decide where lines wrap. */
|
||||
-webkit-hyphens: none;
|
||||
hyphens: none;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue