Skip to content

Commit 4384ecc

Browse files
authored
pre { tab-size: 2; } 🎉 (#1910)
1 parent b5cdbd9 commit 4384ecc

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

.changeset/lazy-rockets-swim.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cloudfour/patterns': minor
3+
---
4+
5+
Set the `tab-size` for `pre` elements to `2` to encourage more accessible code samples without compromising horizontal real estate

src/base/_defaults.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ audio {
129129
* Code blocks
130130
*
131131
* 1. Don't allow code blocks to overflow willy-nilly.
132+
* 2. Set a shallower tab size to encourage accessible code samples without
133+
* compromising horizontal real estate.
132134
*/
133135

134136
pre {
@@ -137,6 +139,7 @@ pre {
137139
color: color.$text-light;
138140
overflow: auto; /* 1 */
139141
padding: ms.step(1);
142+
tab-size: 2; /* 2 */
140143
}
141144

142145
/**

src/design/defaults.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ For syntax highlighting, see [our Prism theme](/docs/vendor-prism--bash-shell).
106106
<Story name="Code block">
107107
{() => {
108108
const example = `* {
109-
box-sizing: border-box;
109+
box-sizing: border-box;
110110
}`;
111111
return `<pre><code>${example}</code></pre>`;
112112
}}

0 commit comments

Comments
 (0)