{% customstyle %}
....
{% endcustomstyle %}
Design editor is an UI extension that allows site editor to change given parameters of CSS like background colour or font.{% customstyle %}
:root {
/* VoogStyle
"path": ["Main Styles"],
"title": "Bg color",
"editor": "colorPicker",
"boundVariables": ["--title-color"]
*/
--page-color: red;
}
body {
color: var(--page-color);
}
{% endcustomstyle %}
The syntax in the "/* Voogstyle" comment must be valid JSON syntax, meaning the keys must be escaped in double quotes and comma separated and tailing comma in lists is not allowed."states": {
"on": "italic",
"off": "normal"
}
"list": [
{ "title": "Arial", "value": "Arial, Helvetica, sans-serif" },
{ "title": "Tahoma","value":" Tahoma, Geneva, sans-serif" },
{ "title": "Courier", "value": "\"Courier New\", Courier, monospace" }
]
List can be grouped:"list": [
{ "type": "group",
"title": "Serif Fonts",
"list": [
{ "title": "Georgia", "value": "Georgia, serif" },
{ "title": "Palatino", "value": "\"Palatino Linotype\", \"Book Antiqua\", Palatino, serif" },
{ "title": "Times", "value": "\"Times New Roman\", Times, serif" }
]
},
{ "type": "group",
"title": "Others",
"list": [
{ "title": "Arial", "value": "Arial, Helvetica, sans-serif" },
{ "title": "Tahoma","value":" Tahoma, Geneva, sans-serif" }
]
},
{ "title": "Courier", "value": "\"Courier New\", Courier, monospace" }
]
document.addEventListener('edicy:customstyles:change', function(event) {
console.log(event.detail.changes);
});