Skip to content
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

[css-align][css-shapes] Circular center alignment #1849

Open
Crissov opened this issue Oct 5, 2017 · 3 comments
Open

[css-align][css-shapes] Circular center alignment #1849

Crissov opened this issue Oct 5, 2017 · 3 comments

Comments

@Crissov
Copy link
Contributor

Crissov commented Oct 5, 2017

For center alignment, matching the center of the smallest possible virtual circle (or possibly ellipse) surrounding the box to align with the same center of its alignment container may give better visual results than using the horizontal and vertical center of rectangular boxes. I propose a new positional alignment keyword circular-center for this.

This alignment is particularly useful for non-rectangular boxes as specified in [css-shapes], but the level-1 draft of this module only considers custom shapes for floating boxes. For rectangular boxes and shapes, circular-center equals center.

@Crissov
Copy link
Contributor Author

Crissov commented Mar 3, 2024

Alternatively, a new property could be introduced to specify the “gravitational” center of a box which is used for (center) alignment.

@tabatkins
Copy link
Member

I'm not sure I understand what's being requested here. For rectangles, the circumcircle has the same center as the rectangle itself.

The medium post you've linked to describes the use of a circumcircle around the non-rectangular shape, which can definitely give a different answer than the center of the shape's bounding box. But we only have rectangles to work with.

@Crissov
Copy link
Contributor Author

Crissov commented Mar 5, 2024

Yes, that is why I referenced the Shapes module. Its shape-outside currently only affects the float area of float elements (defaulting to the margin box) and not the alignment subject (also defaulting to the margin box). This would need to change for circular-center to differ from center.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants