Skip to content

Commit

Permalink
Add support for font sizes in the code block (#27294)
Browse files Browse the repository at this point in the history
  • Loading branch information
scruffian authored Nov 26, 2020
1 parent d4ef8c3 commit 8b748e3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion packages/block-library/src/code/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
}
},
"supports": {
"anchor": true
"anchor": true,
"fontSize": true
}
}
10 changes: 7 additions & 3 deletions packages/block-library/src/code/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// Provide a minimum of overflow handling.
.wp-block-code code {
white-space: pre-wrap;
overflow-wrap: break-word;
.wp-block-code {
font-size: var(--wp--preset--font-size--extra-small, 0.9em);

code {
white-space: pre-wrap;
overflow-wrap: break-word;
}
}
1 change: 0 additions & 1 deletion packages/block-library/src/code/theme.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.wp-block-code {
font-family: $editor-html-font;
font-size: 0.9em;
color: $gray-900;
padding: 0.8em 1em;
border: 1px solid $gray-300;
Expand Down

0 comments on commit 8b748e3

Please sign in to comment.