-
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
Categories: Add a list style type option to the categories block #51344
base: trunk
Are you sure you want to change the base?
Conversation
}, | ||
"listStyleType": { | ||
"type": "string", | ||
"default": "inherit" |
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'm not sure if the default should just be an empty string.
Size Change: +121 B (0%) Total Size: 1.69 MB
ℹ️ View Unchanged
|
Flaky tests detected in aad17d9. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5286920217
|
You got me thinking about language-specific types and whether we could let GlotPress translators opt in to one extra type of their choice. It might look like this: /**
* translators: If your language uses a specific numeral system supported by
* the CSS property 'list-style-type', you may enter its code here. Examples
* include 'armenian', 'trad-chinese-informal', 'kannada'. Otherwise, enter
* 'lower-roman' to opt in to lowercase Roman numerals. Do not translate into
* your own language.
*/
const extraStyleTypeValue = _x( 'lower-roman', 'List item style type. Do not translate!' );
/**
* translators: For context, see string 'lower-roman' with the context 'List
* item style type'. If you have entered a custom value to replace the use of
* lowercase Roman numerals with a numbering system that better suits your
* language, please enter its name here translated into your language.
* Otherwise, enter a direct translation of "Roman numerals". For example,
* "Numeração romana" if you have chosen Roman numerals and are translating
* into Portuguese.
*/
const extraStyleTypeLabel = _x( 'Roman numerals', 'List item style description' );
if ( extraStyleTypeValue && extraStyleTypeLabel ) {
options.push( {
value: extraStyleTypeValue,
label: extraStyleTypeLabel,
} );
} Now, if we were to introduce this, it might be a general editor value and not just applicable to the Categories block. /cc @akirk who might be interested in this :) |
Btw, I based my suggestion on this precedent: gutenberg/packages/block-library/src/post-excerpt/edit.js Lines 79 to 84 in 625b2de
|
afb916a
to
3838305
Compare
I fixed a minor conflict and addressed the yoda expression the linting complained about. This tested out fine for me. |
Could we make the list block and the categories list match better? In the list block, the option to choose between ol and ul is in the toolbar, and there are only style options for the ol. In the category block, there are only style options for the ul, this is confusing. |
Yeah, it'd be nice to align the experience of lists and its featureset. |
What?
This adds a list style type attribute to the categories list block.
Why?
The current block isn't customizable, so it's not possible to change the discs without CSS. This is quite a strong opinion, so it would be good if themes could use the block without needing to use this style.
How?
Adds a
listStyleType
attribute to the categories block.Testing Instructions
Screenshots or screencast