1

Support arrays for data preset values to render UI option lists

new
December 11, 2025

When registering data-attribute presets in GreenShift that have multiple value options, it is not possible to create different presets for each option. Leaving the data option empty lets users enter any value in a single preset, but that approach requires to know the exact values used by the CSS.

It is possible to pass an array to the data, but that is currently treated as a concatenated string in the settings field. It provides the available options, and can be modified to a single value, but it\’s poor UX.

A better option would be to render arrays in the data option as a drop down menu in the settings.

3 responses to “Support arrays for data preset values to render UI option lists”

  1. indigetal Avatar
    indigetal

    A related issue that I recently found is that GreenLight blocks can only take 1 data-atttribute.

  2. indigetal Avatar
    indigetal

    Another data preset-related feature that I discovered would be very useful is related to keeping custom presets from cluttering up the preset drop down in the settings UI:

    As I complete the design of each section, I am creating block patterns of them as components so they can easily be dropped in with all the included classes and required html structure. Instead of creating 2 or 3 variations of those components, I use data attribute presets as modifiers to create variations using the same block pattern. These data preset modifiers are always included in the preset drop down in GreenShift, but they only work with html elements that have a specific class.

    If there was a way to filter data presets for specific html elements or classes, that would allow me to clean up irrelevant data preset modifiers and make the relevant ones far easier to locate. Right now, I’m just using descriptive names like “Equal Columns – Vertical Alignment” (there is a block pattern that includes a section tag with the .equal-columns class).

  3. indigetal Avatar
    indigetal

    I resolved the issue with only 1 data-attribute being output in the HTML, which was an actual problem. The feature request to render the “Data” field in the Class System panel as a drop down when an array is used for multiple value options would still be great!

Leave a Reply

Your email address will not be published. Required fields are marked *

Latest Voters