mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-12-05 01:29:32 +01:00
fix(web): inline code and links in a table cell break anywhere
Chromium never breaks a line after `/`, so under the cells' `break-word` a URL, an identifier or a hash in backticks set its column's width, and the whole table scrolled sideways on a phone. Inline code and links in a cell now break anywhere, and a cell holding one gets the 6em floor that cells with a linked path had. In a 360 px column in Chromium and Firefox, URL, identifier and hash tables fit as they did on master. Two costs remain. A code-only column such as `-v` grows from 52 px to 80 px. CSS cannot tell an autolink from a link with a prose label, so a long word in a label can break mid-word in a narrow column. The test's selector lookup now splits a selector list only on commas outside parentheses, so it can find the `:is()` and `:has()` rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5588a54e3f
commit
691ea6c87a
2 files changed
+43
-10
No files matched your search
@@ -14126,9 +14126,20 @@ html:is([data-skin="paper-gray"], [data-skin="solarized-light"], [data-skin="cat
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
/* A linked path keeps `word-break: break-all` (the a.rv-path rule below), which lets its
|
||||
column shrink the same way. A floor keeps about ten characters of the path per line. */
|
||||
.rv-table-wrap td:has(a.rv-path:not(.rv-path-link)) {
|
||||
/* Inline code and links hold long tokens such as URLs, identifiers and hashes. Chromium
|
||||
finds no break point inside one, since it never breaks after `/`. Under `break-word`
|
||||
the longest token set its column's width and the whole table scrolled sideways, so
|
||||
these tokens break anywhere. A linked path already does, through the `break-all` of
|
||||
the a.rv-path rule above. CSS cannot tell an autolink from a link with a prose label,
|
||||
so a label breaks anywhere too. The one exception is a path link's label
|
||||
(.rv-path-link), which keeps breaking between words. */
|
||||
.rv-table-wrap td :is(code, a:not(.rv-path-link)) {
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
/* Breaking anywhere lets a column shrink to one letter per line, so a cell holding such
|
||||
a token gets a floor of about ten characters. */
|
||||
.rv-table-wrap td:has(code, a:not(.rv-path-link)) {
|
||||
min-width: 6em;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user