-
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
Drop cap and Alignment both option not working properly #11756
Comments
Above issue will fixed if we remove float left from below css code. p.has-drop-cap:not(:focus):first-letter { |
Tested and confirmed that the drop cap letter alignment does not change with the rest of the text.
|
I agree with Naerriel's comment. I think the align right button should be disabled when the drop cap is enabled. |
@jasmussen - can you help to clarify how it should be implemented? |
That is an EXCELLENT question. I looked up the typographical behavior on Wikipedia, it's interesting reading. The term is "initial", which is a large first letter, and usually the three styles of intitials include the first letter just being big, one where the first letter sits in the left margin, and the style the block editor uses, the drop-cap, where a quarter of the text is indented to make space for the large first letter. The first of these three, as Rebecca suggests, lends itself to working with right aligned text, whereas the two other styles do not, and are inherently tied to left-aligned or justified text (though to be clear, on RTL reading directions the dropcap should float on the right where the text starts). Since the block editor currently embraces the drop-cap style, it seems like the correct thing to do here would be to disable, perhaps with a line of explanatory help-text below, the drop-cap button when the alignment is anything other than left (or right for RTL languages). |
Okay, I'll take a look into this! |
Hides drop cap when the text is not aligned with the direction of reading. Fixes #11756.
I see both PR's associated with this issue have gone stale. Joen @jasmussen |
I can work on it... But how is it supposed to work? Should the drop cap option be disabled? |
It could work like this. With unaligned text, you get the usual behavior: If you center or right align, you'd get this: Note the help text, "Aligned text cannot have a dropcap". It could potentially use better verbiage, but I intentionally avoided using "Centered text" or "Right aligned text", as we want to handle RTL situations also. And on that note, dropcap in RTL looks a bit broken — but that could be because I'm using english text in an arabic context. I would imagine, and be happily corrected, that for RTL text, the dropcap should only work in the default alignment, i.e. right, and be disabled for center/left alignments. |
Sorry for taking so long to respond.
@jasmussen From what I found, that might not be the reason why it's broken: I think that the culprit might be twenty twenty-one theme, at least in my tests:
Besides that, the only necessary fix might be changing the drop cap help text and disabling the CSS rules when center/opposite alignment (left in RTL, right in LTR) is applied. |
@rafaelgalani Thank you for the excellent investigative work! That does make it seem like a Twenty Twenty One bug. My instinct is that we should not add !important to the block editor rules if we can avoid it. In this case, it's clearly a bug that is worth fixing directly in the Twenty Twenty One theme — it needs to simply remove most of those drop cap rules, and keep only the ones that override. I see the code here: https://github.com/WordPress/twentytwentyone/blob/trunk/assets/css/ie-editor.css#L3220 Would you be willing to open a ticket for it? It would need to be done here: https://core.trac.wordpress.org/newticket?component=Bundled+Theme&summary=Twenty+Twenty-One You can also search existing tickets here: https://core.trac.wordpress.org/search?q=twenty+twenty-one Let me know, otherwise I'll open a ticket. Thanks again! |
@jasmussen There was no open ticket related to this issue, so here's the one I created: https://core.trac.wordpress.org/ticket/52885. |
Thank you that's perfect! |
Do we still want to remove the visual drop cap when the paragraph is aligned? |
Describe the bug
Drop cap and text alignment both settings do not work in new editor.
To Reproduce
Steps to reproduce the behavior:
Screenshots
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: