-
Notifications
You must be signed in to change notification settings - Fork 304
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
[Layout] Baseline vertical alignment #96
Comments
You are definitely correct here, but there is also currently no way of specifying multiple font sizes within one container (i.e. rich text) Just to clarify, does declaring two seperate text elements and using |
Right, I mean multiple text elements with Here's an image because it will be easier to explain this visually: green - parent; blue - bounding box; red - baseline
To reiterate, this isn't a richtext component, it's a layout row, first is suggested To implement this, you'd need to:
If user doesn't specify baseline for fonts, they would still get This suggestion is something that richtext usually handles as well, but it's also part of component layouting that's text aware. It might also be a good idea to allow non-text children to also specify baseline offset. This will make your code simpler and could be useful in some cases - rasterized SVG image containing a LaTeX expression is an image (non-text) but still technically has a baseline. For the default baseline offset value of 0, it should still will work as shown on the first row. |
Thank you so much for the in depth explanation, I totally understand what you're talking about now. A picture is worth a thousand words! 😁 |
There's no way of aligning text elements of different font size/family in same row based on font baseline property.
Baseline should be added to
CLAY_TEXT_CONFIG
and responsibility for specifying the correct baseline delegated to consumer, defaulting to 0px from the bottom. This would make the default behave asbottom
aligned text.I'd expect non-text components to have baseline 0 as well, so baseline aligned boxes would behave the same as bottom aligned ones.
The text was updated successfully, but these errors were encountered: