Skip to content
This repository was archived by the owner on Nov 2, 2024. It is now read-only.

Commit 19d1c17

Browse files
authored
Reduce specificty for wp-block-code styles (#141)
Moves padding, margin, border styles to :where() selector to allow for theme.json to override. Fixes #140
1 parent 180f934 commit 19d1c17

File tree

5 files changed

+21
-6
lines changed

5 files changed

+21
-6
lines changed

assets/prism-a11y-dark.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,12 @@ pre[class*='language-'] {
3939
/* Code blocks */
4040
pre.wp-block-code {
4141
background: #2b2b2b;
42+
overflow: auto;
43+
}
44+
45+
:where(pre.wp-block-code) {
4246
padding: 1em;
4347
margin: 0.5em auto;
44-
overflow: auto;
4548
border-radius: 0.3em;
4649
}
4750

assets/prism-ghcolors.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,14 @@ code[class*='language-'] {
3737
/* Code blocks */
3838
pre.wp-block-code {
3939
background: #b3d4fc;
40+
background-color: white;
41+
overflow: auto;
42+
}
43+
44+
:where(pre.wp-block-code) {
4045
padding: 1em;
4146
margin: 0.5em auto;
42-
overflow: auto;
4347
border: 1px solid #dddddd;
44-
background-color: white;
4548
}
4649

4750
.token.comment,

assets/prism-nord.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,12 @@ pre[class*='language-'] {
3636
/* Code blocks */
3737
pre.wp-block-code {
3838
background: #2e3440;
39+
overflow: auto;
40+
}
41+
42+
:where(pre.wp-block-code) {
3943
padding: 1em;
4044
margin: 0.5em auto;
41-
overflow: auto;
4245
border-radius: 0.3em;
4346
}
4447

assets/prism-onedark.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,12 @@ code[class*='language-'] ::selection {
5555
/* Code blocks */
5656
pre.wp-block-code {
5757
background: #282c34;
58+
overflow: auto;
59+
}
60+
61+
:where(pre.wp-block-code) {
5862
padding: 1rem;
5963
margin: 0.5em auto;
60-
overflow: auto;
6164
border-radius: 8px;
6265
border: none;
6366
}

assets/prism.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,12 @@ pre[class*='language-'] {
3939
/* Code blocks */
4040
pre.wp-block-code {
4141
background: #2b2b2b;
42+
overflow: auto;
43+
}
44+
45+
:where(pre.wp-block-code) {
4246
padding: 1em;
4347
margin: 0.5em auto;
44-
overflow: auto;
4548
border-radius: 0.3em;
4649
}
4750

0 commit comments

Comments
 (0)