-
Notifications
You must be signed in to change notification settings - Fork 127
Potential problems with the flex CSS on the annotation text style #555
Comments
I can't think of a CSS solution for this issue, and while I was sure of that I took some time to go through different options. Having a max width won't work when inline flex (or inline block) is on the same element. Is it required to have a style for annotation on a heading? That doesn't seem to be the right element to use as an annotation. Would be much easier if it were just an option for the paragraph block, the inline property could be removed and it would just work as-is. |
@jasmussen Why does the paragraph need to be |
I'm assuming it's more to do with how a heading looks as an annotation and spanning the full width of the content area not being the desired look. |
I recommend Git Lens in VS code, it's usually better at digging up the full PR context, in this case there's additional context in #432. Troy above is right: the goal is to create a pill-shape around just the text, not the full block. I think I have an alternate solution outlined in this codepen. GIF:
This relies on the |
CC: @juanfra @carolinan what do you think on the above solution for the annotation style? |
Looks really good Joen! Thank you. I'll put that in a PR. |
In context, the fix is not working as expected as the editor layout relies on having the left and right margin set to auto (with For the front-end, setting the There are also some patterns where the annotation style is being used, that would be compromised as the fix changes the positioning. I believe we'll need to iterate and look for a different angle. Screen.Recording.2024-10-15.at.17.42.24.mov |
Thank you for exploring. In a quick test of my own, I'm not able to reproduce what you're seeing. I'm adding this as the inline CSS:
And it's working as below: What nuance am I missing? That said, if |
Thanks Joen!
I see! I was doing the same but using
Perfect, if we're ok with the centering then we're good with this one. I'm opening the PR (for real this time, lol) |
I responded on the PR, thanks again. I'm personally in favor of keeping the !important, as it seems to work better in more situations. The centering as a fallback can work if there's a good reason. |
When the annotation text style is added to a paragraph or heading that is placed directly inside the post content, not nested in other blocks,
Without the flex CSS, the border around the block extends past the length of the text content itself, but all the options do work.
I would like to ask that it is carefully considered which of these scenarios is the best and less confusing for the user.
The text was updated successfully, but these errors were encountered: