File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ sharp.cache(false);
3737
3838const classNamesTransformer : ShikiTransformer = {
3939 name : "class-names" ,
40+ code ( node ) {
41+ node . properties . class = "block-code" ;
42+ } ,
4043 line ( node ) {
4144 node . properties . class = "block-code-line" ;
4245 } ,
Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ import {
211211 pre.style.setProperty("color", "var(--c-code-light)");
212212 });
213213 article
214- .querySelectorAll<HTMLSpanElement>("span .block-code-token")
214+ .querySelectorAll<HTMLSpanElement>(".block-code-token")
215215 .forEach((span) => {
216216 span.style.setProperty("color", "var(--c-code-light)");
217217 });
@@ -241,7 +241,7 @@ import {
241241 pre.style.setProperty("color", "var(--c-code-dark)");
242242 });
243243 article
244- .querySelectorAll<HTMLSpanElement>("span .block-code-token")
244+ .querySelectorAll<HTMLSpanElement>(".block-code-token")
245245 .forEach((span) => {
246246 span.style.setProperty("color", "var(--c-code-dark)");
247247 });
Original file line number Diff line number Diff line change @@ -44,7 +44,6 @@ article {
4444 background-color : var (--c-accent-2 );
4545 }
4646 pre {
47- padding : v-size (4 , " em" ) 0 ;
4847 border-radius : 10px ;
4948 background-color : var (--c-code-light-bg );
5049 color : var (--c-code-light );
@@ -54,8 +53,9 @@ article {
5453 color : var (--c-code-dark );
5554 }
5655 }
57- .block-code-line :not (:empty ) {
58- margin : 0 v-size (6 , " em" );
56+ .block-code {
57+ display : inline-block ;
58+ margin : v-size (4 , " em" ) v-size (6 , " em" );
5959 }
6060 .block-code-token {
6161 color : var (--c-code-light );
You can’t perform that action at this time.
0 commit comments