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

Commit

Permalink
Reduce specificty for wp-block-code styles (#141)
Browse files Browse the repository at this point in the history
Moves padding, margin, border styles to :where() selector
to allow for theme.json to override.

Fixes #140
  • Loading branch information
mkaz authored May 8, 2024
1 parent 180f934 commit 19d1c17
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
5 changes: 4 additions & 1 deletion assets/prism-a11y-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ pre[class*='language-'] {
/* Code blocks */
pre.wp-block-code {
background: #2b2b2b;
overflow: auto;
}

:where(pre.wp-block-code) {
padding: 1em;
margin: 0.5em auto;
overflow: auto;
border-radius: 0.3em;
}

Expand Down
7 changes: 5 additions & 2 deletions assets/prism-ghcolors.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ code[class*='language-'] {
/* Code blocks */
pre.wp-block-code {
background: #b3d4fc;
background-color: white;
overflow: auto;
}

:where(pre.wp-block-code) {
padding: 1em;
margin: 0.5em auto;
overflow: auto;
border: 1px solid #dddddd;
background-color: white;
}

.token.comment,
Expand Down
5 changes: 4 additions & 1 deletion assets/prism-nord.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ pre[class*='language-'] {
/* Code blocks */
pre.wp-block-code {
background: #2e3440;
overflow: auto;
}

:where(pre.wp-block-code) {
padding: 1em;
margin: 0.5em auto;
overflow: auto;
border-radius: 0.3em;
}

Expand Down
5 changes: 4 additions & 1 deletion assets/prism-onedark.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ code[class*='language-'] ::selection {
/* Code blocks */
pre.wp-block-code {
background: #282c34;
overflow: auto;
}

:where(pre.wp-block-code) {
padding: 1rem;
margin: 0.5em auto;
overflow: auto;
border-radius: 8px;
border: none;
}
Expand Down
5 changes: 4 additions & 1 deletion assets/prism.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ pre[class*='language-'] {
/* Code blocks */
pre.wp-block-code {
background: #2b2b2b;
overflow: auto;
}

:where(pre.wp-block-code) {
padding: 1em;
margin: 0.5em auto;
overflow: auto;
border-radius: 0.3em;
}

Expand Down

0 comments on commit 19d1c17

Please sign in to comment.