pretagov / nswdesignsystem.plone6

GNU General Public License v2.0
1 stars 1 forks source link

I can be guided to only pick colours which follow the brand guidelines #24

Open djay opened 2 months ago

djay commented 2 months ago

Description

Currently there are several issues with the independent theme control panel. The following need to be implemented:

JeffersonBledsoe commented 2 months ago

@djay What about "NSW Settings" or just "NSW" for the control panel rename?

JeffersonBledsoe commented 2 months ago

@djay How much should we improve the experience by? Adding in backend validation through directives and invariants and some filtering of the colours pickers would solve the first three the quickest, however it wouldn't be ideal as the person changing the settings would have to press save before realising that they can't use the selected colours. The settings are currently backend-driven as there isn't any React code for the control panel except for the adjusted colour picker. We would likely have to either make the entire control panel React, or figure out a way for the colour picker to be colour-agnostic in some places, but have it be 'colour filtered' in others. The latter might be possible now that I'm thinking about this some more. The widget could have options that the backend can set through the frontendOptions directive that is used throughout Volto.

djay commented 2 months ago

@JeffersonBledsoe NSW or NSW settings is fine. Validation is better than nothing and is an ok first step with the right description. But can't we at least have two different vocabs for light and dark? That doesn't require any interaction between fields.

JeffersonBledsoe commented 2 months ago

@djay The interaction between fields is needed for the All the colours can only be picked from two columns only option. Otherwise yes, we can easily separate the colours out. We mark a field needing the colour picker by doing the following:

directives.widget(
        "nsw_brand_light",
        frontendOptions={
            "widget": "color_picker",
            "widgetProps": {"colors": COLOUR_PALETTE},
        },
    )

So we can easily either send less colours in the COLOUR_PALETTE, or we can send all the colours and have a mode=light option to specify whether to only show light or dark colours