-
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
Allow defining custom Aspect Ratio options through theme.json
#57707
Comments
Regarding the gutenberg/packages/block-editor/src/components/image-editor/aspect-ratio-dropdown.js Lines 49 to 114 in 5d063e3
|
There's a PR for theme-defined aspect ratios here: #47271 |
Looks like this can be closed out with #47271 merged. Closing but happy to reopen if I'm missing an aspect of this. |
There are a few places now where we allow users to select an Aspect Ratio for their Image. The list of available Aspect Ratios is hard-coded however. (See:
gutenberg/packages/block-library/src/post-featured-image/dimension-controls.js
Lines 93 to 126 in 5d063e3
This means that there is currently no way to use any aspect ratios that are not a part of this predetermined list.
Especially in more custom designs we are working with style guides that go down to the aspect ratio level and not being able to filter / override the ratios that should be available is a real issue.
Ideally this could work similar to the
spazingSizes
preset intheme.json
where a theme author and eventually maybe even the global styles interface would be able to define the available aspect ratios.My proposed syntax would be:
The text was updated successfully, but these errors were encountered: