Skip to content

Commit b74d47a

Browse files
authored
fix(tokens): horizontally-scroll the token table on mobile; stop hex defaults splitting (#9)
Wrap the table in an overflow-x container with min-width:720px so narrow viewports scroll instead of collapsing the CSS-variable column, and switch the Default cell to overflow-wrap:anywhere so short values like #204ce5 stay on one line (only genuinely long values wrap).
1 parent 7e2e478 commit b74d47a

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/pages/gravityview/css-tokens.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ function TokenReference() {
124124
<span style={{ color: 'var(--ifm-color-emphasis-600)', fontSize: 14 }}>{filtered.length} tokens</span>
125125
</div>
126126

127-
<table>
127+
<div style={{ overflowX: 'auto' }}>
128+
<table style={{ minWidth: '720px' }}>
128129
<thead>
129130
<tr>
130131
<th>CSS variable</th>
@@ -146,7 +147,7 @@ function TokenReference() {
146147
<span style={{ marginLeft: 6, fontSize: 11, color: 'var(--ifm-color-success-dark)' }}>themeable</span>
147148
) : null}
148149
</td>
149-
<td style={{ width: '160px', wordBreak: 'break-word' }}>
150+
<td style={{ width: '160px', overflowWrap: 'anywhere' }}>
150151
<code>{t.default === '' ? '(unset)' : t.default}</code>
151152
</td>
152153
<td style={{ fontSize: 13, width: '140px' }}>
@@ -157,7 +158,8 @@ function TokenReference() {
157158
</tr>
158159
))}
159160
</tbody>
160-
</table>
161+
</table>
162+
</div>
161163
</div>
162164
);
163165
}

0 commit comments

Comments
 (0)