jacklenox/susty

Add Gutenberg theme options

Closed this issue · 4 comments

Right now, Susty doesn't support Gutenberg-specific theme options (I'm mainly thinking of the wide and full width image options).

Some simple details on how they are added can be found here - https://www.elmastudio.de/en/get-your-wordpress-theme-gutenberg-ready/.

Now, this is going to add extra styling information to the front-end, so I'm wondering if it could be switchable, with a default of "off". This may be the longer term solution for more options in Susty to make it more palatable for people to use - for example, if a widget area is required to be included on wp.org, you could add it but have it switchable too. Back-end admin options won't impact front-end size either, although you can even make them theme code activated for now.

Gutenberg styling is the one thing that's stopping me from using Susty right now.

I am not sure if that would be a good idea. Gutenberg adds a lot of unnecessary markup which would increase the dom. Also Gutenberg is based on a very heavy javascript framework, which would also increase the load-time, resources size and requests, which is actually what Susty is trying to cut off.

benlk commented

Gutenberg and WordPress ship a stylesheet with default, highly-opinionated styles for blocks. Sites can opt out of those styles, but it's presently an all-or-nothing thing: You either get styles for all blocks, or styles for no blocks. Themes can write their own styles for blocks in either case, but overriding Gutenberg's block-specific styles is somewhat of a pain because of selector specificity.

Gutenberg (and WP Core, several releases behind) are gradually getting better at removing the opinionated styles and decreasing selector specificity.

However, for Susty's purposes, it may be easier to dequeue the core block stylesheet and ship its own styles for those blocks.

Gutenberg adds a lot of unnecessary markup which would increase the dom.

In my experience this is not the case. Generally, Gutenberg just sprinkles a bunch of additional HTML classes and occasional inline styles in the markup. At most it's a spare div for presentational styles in certain blocks.

From the point of view of someone using Susty to publish post content, the "unnecessary markup" is in fact necessary because that markup is the content. But let's not enter a flamewar about markup used by the Block Editor.

Also Gutenberg is based on a very heavy javascript framework, which would also increase the load-time, resources size and requests,

As far as I've seen, Gutenberg does not load additional javascript on the front end of the site. The JS lift is in the editor.

As far as I've seen, Gutenberg does not load additional javascript on the front end of the site. The JS lift is in the editor.

Backend Load is just as important for a sustainable web as the frontend. It's like shifting the ressource use from one point to another. Tho, I gotta admit, that Gutenberg itself is already doing a lot to save energy and ressources. ;)

And yes, they are reducing the additional markup step by step, which I find very good. Afterall, we should not forget, that Gutenberg Editor is basically still in it's early ages.

I'm closing this up. The idea behind Susty was to show what could be achieved - Jack has admitted that some of it (including, I suspect non-support of GB) means that few people would consider using this theme as it's so cut-down.

I'm going to work on a child theme to do this - for now, I think it's out of scope.