Wish: more robust Color swatch handling

As 2024 unfolds, I’d appreciate upgrades to the swatch manager.

When using templates, we can define ‘Primary’ and ‘Primary Variant’ swatches. If saved blocs and brics reference these swatches, we can build out our pages, then make adjustments to these Primary swatches and the changes trickle down across all of the elements using them. Very straightforward.

However, I recently learned that this functionality is limited to only two swatches. I would very much like any named swatch to behave this way so that a template maker could build a Design System naming swatches like:

Light theme:
Light surface primary, Light surface primary variant, Light text primary, Light text primary variant.

Dark theme:
Dark surface primary, Dark surface primary variant, Dark text primary, Dark text primary variant.

I would also like to be able to organise the swatch manager a bit, maybe with groups that could be named and dividers in between.

I believe every new project should start with a few base swatches according to Design Systems that many use today. We’d have a default ‘Light’ group that is separated from a default ‘Dark’ group. Each would contain weights like 100, 200, 300…900. Very common across many design tools/systems.

Template makers could then leverage this when building themes, knowing that the naming convention remained constant. It would be very powerful and appreciated. And I don’t think it’s ‘way out there’ in terms of complexity to implement (famously always said by the one who doesn’t have to implement it…)

:clinking_glasses: to a great 2024.

Thanks.

4 Likes

There are 4 colours, Primary, Primary Variant, Secondary, Secondary Variant.

The concept here is to keep the list simple and easier to use, but it could be expanded.

I’ll bookmark this and see what I can come up with.

4 Likes

Ah, so already a 100% improvement to what I thought :blush: so that’s great!

As nice as it is to keep things simple, I’d like to offer the following quote from Homer Kelly:

“Demanding that something complex be ‘kept simple’ doesn’t make it simple. Only incomplete”

In all seriousness, I think that we’ve seen that when designing something like a webpage or a UI, and we’re considering all colors we need to cover light/dark, various shades and borders plus accent colors… we quickly run out of colors—even with 4.

I appreciate that you take it into consideration.

4 Likes

I think thats the challenge, keeping true to the Blocs approach, compared to how other apps may work, which can have more direct control of colour variables that Bootstrap uses for example. And Bootstrap 6 is probably going to see even more enhancements in these variables.

CSS variables are defiantly way more main stream now.

A lot of styling can be achieved with them, without creating a lot of additional classes. Many would suggest this is the approach you should first take when building your website, then add additional classes as needed.

By the way… love the quote.

1 Like

Yes, that might be the way to go. But there’s no way to connect user-defined variables to the swatch manager or the interface, like the inspector color picker, right?

1 Like

Coming back to this thread as I noticed recently that we don’t get the onboarding wizard when building a WordPress theme directly.

@Norm would it be possible to get at least part of the onboarding wizard when building WordPress themes too? Especially defining the colors would be a quick-win.

4 Likes

I agree @brechtryckaert, that would be great. It would also be great if the color variables in the color pallet not only would show in the Wordpress theme customizer, but when changed in the theme it would change the theme colors. Currently, only the background color can be changed in the Wordpress theme customizer.

2 Likes

Oh okay. I though I hadn’t set up primary and secondary correctly, because indeed, in my exported themes, changing those values in the customizer doesn’t change the actual colors.

2 Likes

Is this option not available within Blocs?

1 Like

Well actually I meant this:

I’ve implemented it manually in my WordPress theme, it also shows up in the customizer:

However, only the background color updates when using the color picker in the WordPress customizer. The primary and secondary color pickers don’t update the actual primary and secondary colors in the theme. But if I change them manually in Blocs, I see all elements correctly being updated (so I know it has been set correctly).

1 Like

@Norm is this something you might be able to take a look at? Perhaps it would be a cool onboarding feature to be able to set the primary and secondary colors, perhaps even including the primary-variant and secondary variant, when starting a new WordPress template (much like the onboarding goes when starting from an existing html template for a regular html site)?

Unless the use of primary and secondary colors in the WordPress customizer isn’t supported by Blocs Plus of course :stuck_out_tongue: For now, only the background color picker actually changes a color… (I can provide a fully built theme and blocs file if needed for testing).

This now works brilliantly again as of the release of Blocs 6.1.7.
Thanks again, @Norm :pray:

2 Likes

Sorry it took so long man. Glad its fixed up now.

I’ll be adding some new features to Wordpress Themes very soon, so watch out for some new functionality. :sunglasses:

2 Likes

No worries. Also, can’t wait for extra shiny new features for WordPress in Blocs Plus. Slightly rooting for my suggestion of a secondary menu location setting :wink:

2 Likes

That’s great news that this now working. I had reported this bug quite a while ago. Thanks @Norm

1 Like

Me too! I can’t wait for more Wordpress things in Blocs Plus.

@Norm, in the Blocs API, could you look at the possibility to append a PHP file to the extra-functions.php from a bric? I have several Wordpress bric ideas, but I need to be able to append php code to the extra-functions.php

I have already done some proof of concept, by developing test Brics, the manually adding the PHP code into the code editor.

Thanks.

1 Like

Any news on these perhaps @Norm ? Really looking for more functionality :wink: