Skip to content

Commit b438ab7

Browse files
ericyangpanclaude
andcommitted
style: remove default border and spacing from pre elements
- Remove default border, padding, and margin from pre tags - Apply background, border, and padding only to highlighted code blocks (pre:has(code.hljs)) - Keeps overflow-x: auto for all pre elements - Aligns with previous behavior before syntax highlighting was added 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e454566 commit b438ab7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/app/[locale]/globals.css

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,17 @@ strong {
111111

112112
/* Code block styling */
113113
pre {
114+
overflow-x: auto;
115+
}
116+
117+
/* Only apply background and border for highlighted code blocks */
118+
pre:has(code.hljs) {
114119
background-color: #f6f8fa;
115120
border: 1px solid var(--color-border);
116121
padding: 1.25rem;
117-
margin: 1.5rem 0;
118-
overflow-x: auto;
119122
}
120123

121-
[data-theme="dark"] pre {
124+
[data-theme="dark"] pre:has(code.hljs) {
122125
background-color: #161b22;
123126
border-color: var(--color-border);
124127
}

0 commit comments

Comments
 (0)