From 63fcb71706961a12330dc5199d2d39cb275f022f Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Mon, 26 Jun 2023 15:00:54 -0500 Subject: [PATCH] Fix syntax styling when in unusual places --- src/stylus/core.styl | 7 ++++++- src/stylus/syntax-highlighting.styl | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/stylus/core.styl b/src/stylus/core.styl index ff800b8..1288f75 100644 --- a/src/stylus/core.styl +++ b/src/stylus/core.styl @@ -78,9 +78,14 @@ html,body border-left solid var(--syntax-bpx) var(--syntax-ledg) display flex - .highlight, h1, h2, h3, h4, h5, h6, form, ul, ol, p, details + .highlight, form, ul, ol, p, details margin-top 1em margin-bottom 0.25em + &:first-child { margin-top: 0 } + + h1, h2, h3, h4, h5, h6 + margin-top 2em + margin-bottom 0.25em h1, h2, h3, h4, h5, h6, form, ul, ol, p max-width 60ch diff --git a/src/stylus/syntax-highlighting.styl b/src/stylus/syntax-highlighting.styl index 9268a93..a0fe57a 100644 --- a/src/stylus/syntax-highlighting.styl +++ b/src/stylus/syntax-highlighting.styl @@ -1,4 +1,4 @@ -main > .highlight > pre.chroma +main .highlight pre.chroma border 0 padding 0.25em 0.5em border-left solid 0.25em var(--syntax-left-edge)