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

List Block: add type attribute for ordered list #13888

Closed
igorbenic opened this issue Feb 15, 2019 · 10 comments · Fixed by #15113
Closed

List Block: add type attribute for ordered list #13888

igorbenic opened this issue Feb 15, 2019 · 10 comments · Fixed by #15113
Labels
[Block] List Affects the List Block [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Enhancement A suggestion for improvement.

Comments

@igorbenic
Copy link

Is your feature request related to a problem? Please describe.
I was writing a legal document and I could not choose if the list needs to be in numbers, words or any other type possible. I had to write the whole thing in one LIST block because there is no "start" option also.

Describe the solution you'd like
I would like to add attributes of an OL element as Block options so those are: reversed, type and start.

Describe alternatives you've considered
This can be done using the HTML of the block and changing it but this can be an issue when reloading the page since the save method might not take that into account.

And if you don't know HTML like regular users, there is no way of changing that.

@swissspidy swissspidy added [Type] Enhancement A suggestion for improvement. [Block] List Affects the List Block labels Feb 15, 2019
@ellatrix
Copy link
Member

This seems like something that could easily be added.

@ellatrix ellatrix added the Good First Issue An issue that's suitable for someone looking to contribute for the first time label Apr 19, 2019
@ellatrix ellatrix changed the title List Style options List Block: add attributes for ordered list Apr 19, 2019
@Jackie6
Copy link
Contributor

Jackie6 commented Apr 21, 2019

Hi @ellatrix does this mean we need to create list settings in the sidebar like below?
image

@ellatrix
Copy link
Member

Exactly :)

@gziolo gziolo added the [Status] In Progress Tracking issues with work in progress label Apr 22, 2019
@Jackie6
Copy link
Contributor

Jackie6 commented Apr 23, 2019

@ellatrix I create a pr to fix this issue. There is still some work left to be done. I will continue to work on this. But I would really appreciate if you could provide some early feedback.

@ellatrix ellatrix changed the title List Block: add attributes for ordered list List Block: add type attribute for ordered list Aug 15, 2019
@ellatrix
Copy link
Member

The attributes have been added except for type, which is a bit trickier. See #15113 (comment). I think it will require some core theme changes as well. :)

@ellatrix ellatrix reopened this Aug 15, 2019
@ellatrix ellatrix added [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. and removed Good First Issue An issue that's suitable for someone looking to contribute for the first time [Status] In Progress Tracking issues with work in progress labels Aug 15, 2019
@mcsf
Copy link
Contributor

mcsf commented Aug 30, 2019

@Jackie6, thanks for working on this! My one note is that — for good accessibility — the Type control be a native selectbox component, similarly to how it’s used for the Image size and Default style selections.

selecbox

@skorasaurus
Copy link
Member

skorasaurus commented Dec 6, 2019

I am interested in seeing the additional list types in Gutenberg, willing to help move this forward where possible, and learned that @Jackie6 has added this in this PR but it was later reverted before the PR was merged. @ellatrix asked for it to be made in a new PR which doesn't appear to have been made yet.

From the discussion on that PR (specifically this from @ellatrix , it sounds like the next steps that are needed going forward are:

Additional references:
https://html.spec.whatwg.org/multipage/grouping-content.html#attr-ol-type

@skorasaurus
Copy link
Member

As mentioned above, @ellatrix had mentioned the ordered list styles to be made in a new PR, so I began to re-implement it but there have been quite a bit that has changed (files being moved, etc) in just a few months.

I think I figured out where and how to rewrite that code but there was code in packages/rich-text/src/component/editable.js

but that file has since been removed from Gutenberg (d9de027

Right now, I receive an ReferenceError that type is not defined. My code is at https://github.com/skorasaurus/gutenberg/tree/add/list-other-styles

@ramonjd
Copy link
Member

ramonjd commented Apr 2, 2024

Is it possible that this issue was already solved by:

@skorasaurus
Copy link
Member

I think this can be closed because all of those features (what 'number' to start an ordered list, numbering style (Roman Number, and lower case roman numeral), and reverse order) have all been implemented in Gutenberg for some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] List Affects the List Block [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants