-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
New Block: Description List #20760
base: trunk
Are you sure you want to change the base?
New Block: Description List #20760
Conversation
Fixes #4880 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely cool to see how neatly we can build this now.
Now, can we make this more ergonomic? Suggestions:
dd
: Enter twice to start a newdt
(not too different fromdt
: Space (like List blocks) to convert todd
dd
: (not sure about this one) Backspace to to convert todt
- Add transforms between those two types
- Because DLs are visually so clean, I wonder if we need visual cues to let the user know that they are starting a new
dt
ordd
— but what?
Yes, I left that as a to do :D
I think we should also take into account that you can have multiple Maybe we could have |
Good reminder. Additionally, this to me reinforces the need for us to somehow address: "Because DLs are visually so clean, I wonder if we need visual cues to let the user know that they are starting a new dt or dd"
Might work, yeah. |
keywords: [ __( 'list' ), __( 'definitions' ), __( 'terms' ) ], | ||
category: 'layout', | ||
supports: { | ||
className: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this set to false
?
For consistency, I think we should add color controls to this block if we add them to the List block.
export const settings = { | ||
title: __( 'Description List' ), | ||
description: __( 'List groups of terms and descriptions.' ), | ||
keywords: [ __( 'list' ), __( 'definitions' ), __( 'terms' ) ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think list
is a necessary keyword when the title already includes that word. Maybe glossary
would be a better keyword to use here?
|
||
export const settings = { | ||
title: __( 'Description List' ), | ||
description: __( 'List groups of terms and descriptions.' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description: __( 'List groups of terms and descriptions.' ), | |
description: __( 'List of terms and their descriptions.' ), |
}, | ||
edit, | ||
save, | ||
attributes: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This, the name, and the category should be moved to a block.json
. (Same with other blocks being added in this PR.)
Quite some time has passed since there was any movement here. |
Currently both the WHATWG and the W3C HTML5 standards support grouping |
Wrapping in divs is tricky, because then we somehow need to ensure that inside that div dt elements come first and the dd elements follow. If these are mixed, then there's no point to group them. |
@ellatrix Are you still working on this? And could you summarize anything that's left to be done before this can be merged? |
Quite some time has passed since there was any movement here. Link to the first website ever |
Description
Fixes #4880
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl
This is a block that I think would have been more difficult to implement without the use of light blocks. With light blocks, we're able to use proper semantic tags in the editor, which also allow it to be styled more easily.
To do: it might be could to handle enter/delete from rich text.
How has this been tested?
Screenshots
Types of changes
Checklist: