-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Background color height is incorrect on large text #61
Comments
You are right the step I gave works now but this is unfortunately just a side effect of some internal ordering changes. The reproduction steps are now reversed:
|
Is there any specific reason why |
There could be some flexibility here. What would be your recommendation @krishvs ? |
I dont think this can be fixed using only css and the |
When the font size is applied to the outer element, the background color looks as it should, however, the other way around is when the issue arises. I'm not familiar enough with coffeescript yet, but as @krishvs mentioned you'll have to manipulate the DOM to always wrap the text with the background span first and font size second. Looks OK: <span style="font-size: 32px;">
<span style="background-color: rgb(255, 194, 102);">lt for the modern we</span>
</span> Looks BAD <span style="background-color: rgb(102, 163, 224);">
<span style="font-size: 32px;">e case. Some built in features includ</span>
</span> |
Still an issue for IE: ef93721 |
Sorry had to revert this fix. Turns out it's not a good solution for other browsers either. |
A possible fix is to specify "background-color: inherit" in the font-size span |
Excellent idea! Thanks! |
The fix you committed only works in the editor, and not when the html is displayed afterwards. |
What do you mean when the html is displayed afterwards? The only difference between an inline style and css style is precedence. |
By afterward I mean "once it has been edited", the purpose of the editor being to edit rich text as html, this html is also meant to be displayed after its edition, without no editor in sight. The main difference between inline & css style is not precedence, it is that inline style is part of the html, so when you display the html, inline style is guaranteed to be there, while stylesheet css is not. It would be different if the editor was doing its editing based on css classes rather than inline styles, then having an external stylesheet to go alongside the html would be expected. But given that the editor edits inline styles, IMHO it should maintain coherent inline styles, rather than require a specific css stylesheet for the html to be displayed "as edited". |
There are already several rules in the base Quill stylesheet that would have to be replicated to maintain visual correspondence with the editor. It's also not sufficient to just add the inherit rule to spans--it'd have to be added to all inline styles (otherwise color -> bold -> size would still trigger the bug) which is much messier markup. Fwiw Quill is moving away from inline styles by default in some future release. |
Background color does not fill the entire height. Seems to be because the span controlling the size does not expand its parent (which controls the color). Applying the formatting in reverse (color then size) does not have this issue.
The text was updated successfully, but these errors were encountered: