Archived topic
theme.json makes editor left aligned
3 replies · Started by Neil on November 9, 2021
I am trying to create a custom color palette for a client but when I add the theme.json file it throws the editor to the left.
If I remove the json file the editor goes back to it's normal centrally aligned position.

The code that I have is:
{
"version": 1,
"settings": {
"color": {
"palette": [
{
"name": "Purple Main",
"slug": "purple-main",
"color": "#993393"
},
{
"name": "Purple 50 Main",
"slug": "purple-fifty-percent",
"color": "#c192c2"
},
{
"name": "Green Main",
"slug": "green-main",
"color": "#a2ad00"
},
{
"name": "Pink",
"slug": "pink",
"color": "#cf83cc"
},
{
"name": "Pink Dark",
"slug": "pink-darker",
"color": "#af52ab"
},
{
"name": "Purple Dark",
"slug": "purple-dark",
"color": "#8d1888"
},
{
"name": "Purple Darkest",
"slug": "purple-darkest",
"color": "#6d0b68"
},
{
"name": "Green Light",
"slug": "green-light",
"color": "#c6d20f"
},
{
"name": "Green Dark",
"slug": "green-dark",
"color": "#828b00"
},
{
"name": "White",
"slug": "white",
"color": "#ffffff"
},
{
"name": "Dark Grey",
"slug": "dark-grey",
"color": "#555555"
},
{
"name": "Black",
"slug": "black",
"color": "#000000"
}
]
}
}
}
It seems to be to WP standards and is valid json. Any ideas?
Happy to supply access details if needed.
Hi there,
Have you tried just using the global colors introduced in GP 3.1 recently?
https://docs.generatepress.com/article/using-global-colors/
If you choose the colors in the customizer, the same colors pallet would reflect in the editor.
@leo That's awesome and looks just like I was trying to achieve. Didn't even know it was there.
Thanks for your help.
It was introduced very recently:
https://generatepress.com/generatepress-3-1-global-colors-dynamic-typography/