瀏覽代碼

Blank Canvas Blocks: Make Code block's font-family overwritable

Daniel Dudzic 4 年之前
父節點
當前提交
f28c499b98

+ 4 - 0
blank-canvas-blocks/assets/ponyfill.css

@@ -256,6 +256,10 @@ input[type=checkbox] + label {
 	margin-bottom: 0;
 }
 
+.wp-block-code code {
+	font-family: var(--wp--preset--font-family--code);
+}
+
 .wp-block-gallery .blocks-gallery-image figcaption,
 .wp-block-gallery .blocks-gallery-item figcaption {
 	font-size: var(--wp--custom--gallery--caption--font-size);

+ 10 - 0
blank-canvas-blocks/experimental-theme.json

@@ -85,6 +85,11 @@
 						"fontFamily": "var(--font-headings, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif)",
 						"slug": "headings",
 						"name": "Headings"
+					},
+					{
+						"fontFamily": "monospace",
+						"slug": "code",
+						"name": "Code"
 					}
 				]
 			},
@@ -173,6 +178,11 @@
 						"fontSize": "var(--wp--preset--font-size--small)"
 					}
 				},
+				"code": {
+					"typography": {
+						"fontFamily": "var(--wp--preset--font-family--code)"
+					}
+				},
 				"quote": {
 					"typography": {
 						"textAlign": "left"

+ 1 - 0
blank-canvas-blocks/sass/ponyfill.scss

@@ -10,6 +10,7 @@
 // - These styles replace key Gutenberg Block styles for fonts, colors, and
 //   spacing with CSS-variables overrides
 @import "blocks/button";
+@import "blocks/code";
 @import "blocks/gallery";
 @import "blocks/image";
 @import "blocks/list";