Open Jorckx opened 1 year ago
Same here. I would like to create custom CSS properties in the head section of the page from all values of a central brand-color field blueprint. This way I could let editors choose brand colors in the panel when needed (e.g. for info box backgrounds), and at the same time have all brand colors available for CSS rules – while only having one central place for defining brand colors to keep everything DRY.
I tried to apply the info from https://getkirby.com/docs/cookbook/templating/fetching-field-options to the following (demo) field setup:
type: color-palette
label:
en: Brand Colors
de: Markenfarben
options:
red:
lightMode: "#fecaca"
darkMode: "#991b1b"
contrastLightMode: "#000000"
contrastDarkMode: "#ffffff"
black:
lightMode: "#000000"
darkMode: "#ffffff"
contrastLightMode: "#ffffff"
contrastDarkMode: "#000000"
white:
lightMode: "#ffffff"
darkMode: "#000000"
contrastLightMode: "#000000"
contrastDarkMode: "#ffffff"
display: duo
unselect: true
But I only get the error message Undefined array key "lightMode"
, even if I just try to var_dump
all info from the options
of the field.
Hi! to start, great plugin! I'm just wondering how to output all options (not the selected one) to a template. I want to create a sample-page for my client who uses different page-colour-options.