Skip to content
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

Cover: internal alignment / position #20836

Closed
mtias opened this issue Mar 12, 2020 · 10 comments · Fixed by #21091
Closed

Cover: internal alignment / position #20836

mtias opened this issue Mar 12, 2020 · 10 comments · Fixed by #21091
Assignees
Labels
[Block] Cover Affects the Cover Block - used to display content laid over a background image [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Status] In Progress Tracking issues with work in progress

Comments

@mtias
Copy link
Member

mtias commented Mar 12, 2020

The Cover block is a pretty nice tool. However, its internal positioning is quite inflexible. You can align individual blocks to left / right / center, but not a group, and not vertically.

It'd be neat to explore some more cardinal positions:

image

Combining them in a single tool should help with clarity:

image

Since there is no internal width or padding (at least until the work on dimensions in "Group" is finalized), you should still be able to flush individual blocks to the left or right even with a default set:

image

@mtias mtias added [Block] Cover Affects the Cover Block - used to display content laid over a background image [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi labels Mar 12, 2020
@pablohoneyhoney
Copy link

Added a new icon-position in the icon Figma library.

toolbar-cover

Screen Shot 2020-03-12 at 11 54 53 AM

@pablohoneyhoney
Copy link

pablohoneyhoney commented Mar 12, 2020

Also with the small detail of highlighting the current position. It does depend on the contrast of the accent color.

Paragraph-block-active-1

Paragraph-block-active

Or scale slightly the dot to 4px

Paragraph-block-active-1

Paragraph-block-active

@mtias
Copy link
Member Author

mtias commented Mar 12, 2020

Yes, that's why in the original I was using gray for the non active ones. It's a nice detail, I think.

@pablohoneyhoney
Copy link

Here another iteration.

Screen Shot 2020-03-12 at 12 28 56 PM

And wonder if that function could afford direct manipulation.

Screen Shot 2020-03-12 at 12 29 08 PM

Or even fade out the styles of the cover to focus on the specific interaction.
Screen Shot 2020-03-12 at 12 29 15 PM

Note that these screenshots are not 100%. Click to view.

@ItsJonQ
Copy link

ItsJonQ commented Mar 19, 2020

👋 Haiii! I started experimenting with creating the AlignmentControl component.

I have a working prototype here:

👩‍💻 Code
https://codesandbox.io/s/align-control-u9uwe

✨ Demo
https://u9uwe.csb.app/

Screen Capture on 2020-03-19 at 19-07-46

The Demo showcases an AlignmentControl and an InteractiveGridOverlay (an interactive counter-part to the control).

Some notable features:

  • The AlignmentControl handles focus like a select or any other HTML control element would
  • When focused, use up, down, left, right keyboard commands would move the alignment within the 9x9 grid
  • The components have onChange callbacks to communicate
  • Components can be controlled (accepting new incoming alignments)
  • Alignment definitions are flexible, like CSS. Meaning, top center or center top are both acceptable

@ItsJonQ
Copy link

ItsJonQ commented Mar 20, 2020

@pablohoneyhoney I've made adjustments to my prototype to better match your designs!
I've also created a smaller icon for Align control:

Screen Capture on 2020-03-20 at 11-36-13

Due to the dynamic nature of the icon, from a technical perspective, I think it may be better to create it using HTML/CSS rather than SVG. But, we'll match the Icon dimension/sizes as best as possible to ensure that it looks consistent with the other icons.

@ItsJonQ
Copy link

ItsJonQ commented Mar 20, 2020

Started coding it! Working branch:
https://github.com/WordPress/gutenberg/tree/try/cover-alignment-control

So far, I've focused exclusively on the new Control component.
Will create a PR once it gets integrated into the Cover block.

@pablohoneyhoney
Copy link

Nice! Have we considered a direct manipulation in the block canvas instead of a panel control (dropdown)? This was a premature mock up:

@ItsJonQ
Copy link

ItsJonQ commented Mar 23, 2020

@pablohoneyhoney Yes! I've experimented with direct controls in my prototype:

https://u9uwe.csb.app/

Although, the aesthetics I have make them look like 9 cells/boxes, rather than points (like yours). But the idea is the same :).

One tricky thing re: the Direct manipulation overlay.
The "edit" mode for this needs to be enabled/disabled somehow.

For example (not saying this is how it should be):

  • Click "Align" from toolbar
  • Edit mode engages
  • Makes changes (or not)
  • Click "Cancel" to revert changes. Or. Click "Apply" to apply changes
  • Edit mode disengages

Hope this makes sense 🙏
If it does, it would be cool to see some rough flows or designs for this 😍

@mtias
Copy link
Member Author

mtias commented Mar 23, 2020

I think we should get it into the toolbar first — I can see multiple issues with the in-canvas presentation based on background / image / video presence in the cover block.

We could revisit this in conjunction with #20193

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Mar 23, 2020
@ItsJonQ ItsJonQ mentioned this issue Apr 8, 2020
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Cover Affects the Cover Block - used to display content laid over a background image [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Status] In Progress Tracking issues with work in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants