-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Explore] Site Block #16998
Comments
I took the liberty of creating a mockup for this. It is a relatively direct interpretation of this ticket. Paragraph block selected: Here's what happens if you deselect a block, i.e. select the site block: Note that I included the breadcrumb bar as suggested in #17089 as it would play a part in the discoverability of this. One of the benefits of this approach is that it is relatively simple to implement, UI wise. There are a couple of open questions, though:
For question 2, and depending on where development on the sidebar goes, the tabs might solve this. I.e. selecting the Site might not also select the Site tab. Another approach could be to rethink the sidebar so Site and Document each have their own top-level button, and the Block sidebar becomes fully modal. For question 3 we probably want to allow you to click outside the editing canvas in neutral whitespace like in the editor bar or the sidebar, to deselect blocks. Once again the Escape key could play a role there. |
Another idea I've been toying with is adding a "frame" around the document, and giving it a visual appearance similar to a sheet of paper sitting above another surface. This would provides some room around the document that a user could click on to select a Site. Along with this, it opens up a place for @jasmussen's breadcrumb trail. One question I do have is what we do with the sidebar when the site is selected? Having "Document" and "Block" there could be confusing. Maybe we'd add a "Site" tab? |
Mentally a 'site block' makes sense in terms of a site space. I wonder though if that's a better way to call it, a space? I guess when thinking about a tab in addition for this my brain wonders what document is for. If that's just settings perhaps that needs to be iterated or positioned in other spaces? It's a leap of exploring though as a mental model to have that sidebar. For me, I wonder if having 3 tabs makes sense of confuses types. Are 'document', 'block' and 'site' the same types that would fit the same panel patterns? If we have a better way to show hierarchy in a true navigator, for me then seeing the root space a 'root block' makes sense. |
@shaunandrews' frame concept works well when thinking about responsive preview controls in Gutenberg. If I select a mobile viewport, the frame can adjust to show the site in a mobile view similarly to browsers today. Overall though, I'd prefer a site block to extend to the chrome around it similarly to Joen's concept.
Maybe. If so, it can always be in the Top Toolbar position.
As the mockups exist right now, it's not clear. In the mockups, the Site block isn't providing any indicator that it is selected. Because it's a block, I'm half expecting to see a border somewhere. I don't want this... but would like some visual that a block is still selected.
By clicking the Top Toolbar? It's always in view. I'm not sure it's very intuitive though? I'd expect to click on any negative space and not be stuck in another, difficult to understand, Site block. Really great questions! I'm messing around with some thoughts right now. |
Maybe we should have an interface where the user can customise the header and footer in the Gutenberg editor? I think new users would find the "Site block" idea a little too complex, especially for beginners. |
Though I like the idea of breaking it down like this, a header-content-footer structure is traditional but not global. A site block on the other hand would allow users to do what they want, and a very good candidate for that "site" block is on #18600. Something like that would allow users to do whatever they want, unhindered from traditional limitations. |
It feels like this may not be a thing anymore. Global Styles are being implemented without a Site block, and a Site block just may not be necessary in context of FSE. Do you mind if we close this out, @mtias ? |
This one is still relevant for me because we might end up still attaching all of that to a site block once we figure out how to do the root container (grid, etc). |
I'd like to focus this exploration on whether it makes sense to provide a foundational grid that can cascade to block properties down the tree (for example, every full-width block should inherit the grid) and as a source for top level global styles. cc @johngodley @jasmussen @nosolosw @jorgefilipecosta for thoughts. We might also want to stop referring to it as a Site block and generalize it as an Area. That would coincide with the requirement of allowing different areas to overwrite style properties or layout baselines down the tree. It might be possible to coalesce this entirely into Template Parts as well and reduce concepts. In that case, Areas would be able to define a context that can supersede the base global styles values and integrate into the editing experience by offering focus, grid lines, etc. |
Sounds good, I'll put on my list to do a mockup. |
It's been a busy few weeks, but here are some mockups as promised. Emphasis mockups: I expect conversation to point out many errors. They also do not cover this aspect yet:
How selecting the site block affects the Global Styles sidebar is hopefully a topic that can get some clarity in discussing these mockups. Here's the site editor, showing how to select the Here it is, selected and showing a basic 12 column responsive grid complete with gutters: You can select a template part inside: Those template parts can be aligned to the grid. This part spans the full 12 columns, but the Post Content block inside starts at column 4 and spans 6 columns: |
It would also be beneficial to make it clear what we mean when we say "grid"... |
Great exploration @jasmussen!
I have one question: if I want to adjust the width of the Post Content, I can do so by clicking on the paragraph? |
Doing both, to me "grid" refers to the ability to align things on a page, both vertically but ideally also horizontally. The mockups shown here take a great deal of inspiration from the Layout Grid block which uses CSS grid to create column (and row) areas.
Yes, the interface for selecting blocks should be mostly the same as it exists today. How to make that grid something blocks can snap to as it cascades down the levels is one of the things to think about. Edit: I suppose if you clicked on the paragraph, you'd have to click the "select parent" button a few times to get to the Post Content block. |
Thanks. I do think the 'cascade' can be a bit confusing (that took me a while to figure out using the Layout Grid block) but still worth having as a customization option. Would users also be able to edit the grid and define the column count, gutters and margins size, etc? |
Ideally, a "site" block would help me do this:
When building a site, I'd need to be able to control things in both axis... And the current Layout Grid Block looks more like a glorified-columns block. It's beautifully and exquisitely done, but it's still just columns (unless I missed something while testing it?) |
Going back to this comment which restarted the conversation, it de-emphasizez the "site" term in favor of calling it an "area", one implication seems to be that it might not be a be-all end-all layout building block, but more of a provider of a grid. In that vein, it might be up to the template parts and blocks inside how and whether to align to that grid. So please take the Layout Grid block only as a basic example for how a layout grid can enable alignment across a page, not as a 1:1 comparison. |
If the Site/Area block could provide a grid, then I think it would be up to the theme (perhaps user configurable in the site editor) to configure the gutters and margins. Probably column count too, but we'd need to be careful to make it as theme-switching friendly as possible. |
I'm not a designer, so the "grid" stuff goes over my head, but seeing as this is being billed as a "root" block, I'm wondering if it would be responsible for rendering the doctype, calling wp_head, rendering a template and calling wp_footer? In other words, could the entire template loader and HTML document be relocated into the render_callback of this block? I'm thinking plugins could then replace this with their own version of a site block and be responsible for the HTML document if they want. |
We've moved most of these concerns into global styles as an implicit root. We'll probably keep expanding its capabilities form there. |
As block areas are being explored (#13489) there should some time spent on exploring how a Site block might operate, and whether it's needed as an abstraction. Some of its salient aspects would be:
add_theme_support
qualities (defines a grid, alignment widths, etc).The text was updated successfully, but these errors were encountered: