Skip to content

Instantly share code, notes, and snippets.

@annezazu
Last active February 17, 2022 10:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save annezazu/20a609747d2a030730f3279b0c64123e to your computer and use it in GitHub Desktop.
Save annezazu/20a609747d2a030730f3279b0c64123e to your computer and use it in GitHub Desktop.
Theme.json example showing how you can set up different simple presets for various blocks.
{
"schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {
"layout": {
"contentSize": "800px",
"wideSize": "1000px"
},
"color": {
"custom": true,
"customGradient": true,
"customDuotone": true,
"gradients": [],
"link": true,
"palette": [
{
"name": "Primary",
"slug": "blue",
"color": "#0288d1"
},
{
"name": "Secondary",
"slug": "orange",
"color": "#ff5837"
},
{
"name": "Tertiary",
"slug": "grey",
"color": "#282828"
}
]
},
"typography": {
"customFontSize": true,
"customLineHeight": true,
"customFontWeight": true,
"dropCap": true,
"fontFamilies": [
{
"fontFamily": "Helvetica Neue, Helvetica, Arial, sans-serif",
"slug": "helvetica-arial"
},
{
"fontFamily": "Geneva, Tahoma, Verdana, sans-serif",
"slug": "geneva-verdana"
}
]
},
"blocks": {
"core/cover": {
"color": {
"duotone": [
{
"colors": [ "#f0c443", "#ab0400" ],
"slug": "yellow-and-red",
"name": "Yellow and Red"
}
]
}
},
"core/image": {
"color": {
"duotone": [],
"customDuotone": false
}
},
"core/post-featured-image": {
"color": {
"duotone": [
{
"colors": [ "#282828", "#ff5837" ],
"slug": "black-and-orange",
"name": "Black and Orange"
},
{
"colors": [ "#282828", "#0288d1" ],
"slug": "black-and-blue",
"name": "Black and Blue"
}
],
"customDuotone": true,
"custom": false
}
},
"core/post-title": {
"color": {
"custom": false,
"customGradient": false,
"palette": []
},
"typography" : {
"customFontSize": false,
"customFontWeight": false,
"customLineHeight": false,
"fontSizes": [
{
"slug": "x-small",
"size": 25,
"name": "Small"
},
{
"slug": "x-large",
"size": 35,
"name": "Huge"
}
]
}
},
"core/post-date": {
"color": {
"custom": false,
"customGradient": false,
"palette": []
},
"typography" : {
"customFontSize": false,
"customFontWeight": false,
"customLineHeight": false,
"fontSizes": [
{
"slug": "x-small",
"size": 15,
"name": "Small"
},
{
"slug": "x-large",
"size": 20,
"name": "Huge"
}
]
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment