ソースを参照

Block Canvas: add support for button elements (#6139)

* add support for button elements

* removed test
Maggie 3 年 前
コミット
75f2feed30
2 ファイル変更24 行追加26 行削除
  1. 0 17
      block-canvas/style.css
  2. 24 9
      block-canvas/theme.json

+ 0 - 17
block-canvas/style.css

@@ -49,23 +49,6 @@ GNU General Public License for more details.
 	background-color: var(--wp--preset--color--secondary);
 }
 
-/*
- * Search and File Block button styles.
- * Necessary until the following issues are resolved in Gutenberg:
- * https://github.com/WordPress/gutenberg/issues/36444
- * https://github.com/WordPress/gutenberg/issues/27760
- */
-
-.wp-block-search__button,
-.wp-block-file .wp-block-file__button {
-	background-color: var(--wp--preset--color--foreground);
-	border-radius: 0;
-	border: none;
-	color: var(--wp--preset--color--background);
-	font-size: var(--wp--preset--typography--font-size--normal);
-	padding: calc(0.667em + 2px) calc(1.333em + 2px);
-}
-
 /*
  * Alignment styles, borrowed from Twenty Twenty-Two.
  * These rules are temporary, and should not be relied on or

+ 24 - 9
block-canvas/theme.json

@@ -114,15 +114,6 @@
             "core/button": {
                 "border": {
                     "radius": "4px"
-                },
-                "color": {
-                    "background": "var(--wp--preset--color--primary)",
-                    "text": "var(--wp--preset--color--background)"
-                },
-                "typography": {
-                    "fontSize": "var(--wp--preset--font-size--medium)",
-                    "fontWeight": "normal",
-                    "lineHeight": "2"
                 }
             },
             "core/code": {
@@ -256,6 +247,30 @@
             "text": "var(--wp--preset--color--foreground)"
         },
         "elements": {
+            "button": {
+				"border": {
+					"radius": "0"
+				},
+				"color": {
+                    "background": "var(--wp--preset--color--primary)",
+                    "text": "var(--wp--preset--color--background)"
+				},
+				"typography": {
+					"fontFamily": "var(--wp--preset--font-family--system-font)",
+                    "fontSize": "var(--wp--preset--font-size--medium)",
+                    "fontWeight": "normal",
+					"lineHeight": "2",
+					"textDecoration": "none"
+				},
+				"spacing": {
+					"padding": {
+						"top": "calc(0.667em + 2px)",
+						"bottom": "calc(0.667em + 2px)",
+						"left": "calc(1.333em + 2px)",
+						"right": "calc(1.333em + 2px)"
+					}
+				}
+			},
             "h1": {
                 "typography": {
                     "fontSize": "3rem"