Skip to content

Conversation

@ZackNoyes
Copy link

@ZackNoyes ZackNoyes commented May 6, 2024

First, thanks for this great library!

Currently, #alternatives always lays out elements as inline elements (wrapping them in a box).

This change adds a mode where alternatives can lay elements out as block elements. There are two reasons I can think of that someone might want to do this.

  • For relative width elements, it makes sense to have them laid out as a block and take up the full width of the page, rather than being given 0 width and then not getting laid out properly. See issue #alternative don't work with relative widths #127, which this fixes.
  • For content which one would like to align on the page, we can't do this the naive way by passing it to #alternatives directly since it gets put in a minimum width container that is then inlined. To work around this, one would have to put an align statement outside the alternatives or put the content inside a block before passing it to #alternatives.

Thanks for looking at this! I also added a test and a section to the book. Let me know if anything else would help to make this easier to merge if you agree with the change (I see that you mention you're quite time-poor in other PRs).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant