Skip to content

Commit f5159b8

Browse files
Apply margin to all pre in .nicegui-markdown (zauberzeug#5266)
### Motivation Fix zauberzeug#5264, where the margin is inconsistent when `language=''` ### Implementation * Changed the selector from `.nicegui-markdown .codehilite pre` to `.nicegui-markdown pre` and updated the margin to `0.5rem 0.5rem` to provide both horizontal and vertical margin to both codehilite and non-codehilite code blocks. * Removed unnecessary padding from `.nicegui-code .codehilite`. ### Visual difference Before: <img width="600" alt="image" src="https://github.com/user-attachments/assets/48ce0232-bb6d-4d03-be48-a2a15e6d84c0" /> After: <img width="600" alt="image" src="https://github.com/user-attachments/assets/2e306fdb-12c5-49a0-8978-019f9e7fc059" /> ### Progress - [x] I chose a meaningful title that completes the sentence: "If applied, this PR will..." - [x] The implementation is complete. - [x] Pytests have been added (or are not necessary). - [x] Documentation has been added (or is not necessary). --------- Co-authored-by: Falko Schindler <[email protected]>
1 parent 2a10f12 commit f5159b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nicegui/static/nicegui.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195
padding: 0.5rem;
196196
border: 1px solid #8884;
197197
}
198-
.nicegui-markdown .codehilite pre {
198+
.nicegui-markdown pre {
199199
margin: 0.5rem 0;
200200
}
201201
.nicegui-markdown .mermaid-pre > .mermaid {
@@ -257,7 +257,7 @@ h6.q-timeline__title {
257257
box-shadow: 0 0 0.5em rgba(127, 159, 191, 0.05);
258258
border-radius: 0.25rem;
259259
}
260-
.nicegui-code .codehilite {
260+
.nicegui-code pre {
261261
padding: 0 0.5rem;
262262
}
263263
.nicegui-matplotlib > svg,

0 commit comments

Comments
 (0)