-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Copy/Paste Styles can give a Block a 'style' that it isn't allowed to have #60352
Comments
The "Copy styles" option also copies any custom CSS classes and the asterisk is added by the So I am not sure if this is a bug. Perhaps the Any thoughts on this @jameskoster or @kevin940726? I believe you both were involved in the original implementation. |
I think this issue should be fixed on the TT4 theme side, and the block name should be included in the inline style selector. The following block styles, currently defined in this section, affect all blocks.
I would like to file a core ticket regarding this issue. |
Core ticket: https://core.trac.wordpress.org/ticket/60877 |
I think this is a good point to discuss. I don't have a strong feeling, but anecdotally the current behavior feels a bit unexpected to me. I would anticipate 'Copy styles' to only capture styles added via design tools in the Inspector UI. Applying a custom css class to another block feels like something to do manually. Is the current behavior definitely what we want? |
Agreed -- I wouldn't expect a custom CSS class to be moved over and would want it to only snag what's in the design tools. Curious to hear from others though. |
That is definitely the more expected approach, and I agree with it. Just curious if the CSS classes were explicitly included for some reason. Seems like this was intentional at one point. |
If we want to avoid copying custom CSS classes, we can probably just remove this line.
The ability to paste styles was added in #45477, but this comment also seems to mention class names. @kevin940726, Do you know what the possible problems are if we exclude CSS classes from pasting styles? |
There are lots of things to consider here, and I'm sure pros and cons to
each approach depending on how people are using custom classes.
I'm wondering about something like:
Copy custom CSS classes by default, but only copy "is-style-*" classes if
the target block supports that specific style.
…On Tue, Apr 2, 2024, 9:00 PM Aki Hamano ***@***.***> wrote:
If we want to avoid copying custom CSS classes, we can probably just
remove this line.
https://github.com/WordPress/gutenberg/blob/1655ed0610408f8ec18760033429e4aea1380dfe/packages/block-editor/src/components/use-paste-styles/index.js#L64
The ability to paste styles was added in #45477
<#45477>, but this comment
<#45477 (comment)>
also seems to mention class names.
@kevin940726 <https://github.com/kevin940726>, Do you know what the
possible problems are if we exclude CSS classes from pasting styles?
—
Reply to this email directly, view it on GitHub
<#60352 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHGYBOX7T67Y2WYSSFOJS3Y3NPFNAVCNFSM6AAAAABFSF45ACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZTGQYDAOBVGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
When a block style is selected, the class name " There are several possible approaches, do you have any ideas?
|
Description
When you "Copy Styles" and "Paste Styles" from one block to another, you can give the destination block a style it shouldn't support. For example, with TT4, you can make a Paragraph be "With Asterisk"
Step-by-step reproduction instructions
Using TT4:
Screenshots, screen recording, code snippet
Environment info
6.4.3 and 6.5-RC-4.
With and without latest Gutenberg plugin.
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: