Created
May 20, 2022 17:32
-
-
Save ryanwelcher/d0fa1985bb92dbc95620f606284d2b4e to your computer and use it in GitHub Desktop.
Defining default values for Background color, text color, link color, padding and margin for custom blocks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schemas.wp.org/trunk/block.json", | |
"apiVersion": 2, | |
"name": "create-block/block-supports-test", | |
"version": "0.1.0", | |
"title": "Block Supports Test", | |
"category": "widgets", | |
"icon": "smiley", | |
"description": "Example block written with ESNext standard and JSX support – build step required.", | |
"attributes":{ | |
"content": { | |
"type": "string", | |
"selector": "p" | |
}, | |
"style": { | |
"type": "object", | |
"default": { | |
"color": { | |
"background": "#aabbcc", | |
"text": "#00ff00" | |
}, | |
"elements": { | |
"link": { | |
"color": { | |
"text": "blue" | |
} | |
} | |
}, | |
"spacing": { | |
"padding": { | |
"top": "22px", | |
"right": "22px", | |
"bottom": "22px", | |
"left": "22px" | |
}, | |
"margin": { | |
"top": "42px", | |
"right": "42px", | |
"bottom": "42px", | |
"left": "42px" | |
} | |
} | |
} | |
} | |
}, | |
"supports": { | |
"color": { | |
"background": true, | |
"text": true, | |
"link": true | |
}, | |
"spacing": { | |
"margin":true, | |
"padding": true | |
} | |
}, | |
"textdomain": "block-supports-test", | |
"editorScript": "file:./index.js", | |
"editorStyle": "file:./index.css", | |
"style": "file:./style-index.css" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment