Skip to content

Add flexbox tutorial showing how to realise vertical placements of elements - #33

Merged
seanhess merged 7 commits into
seanhess:mainfrom
benjaminweb:flex-tutorial
Nov 4, 2026
Merged

seanhess merged 7 commits into
seanhess:mainfrom
benjaminweb:flex-tutorial

Conversation

@benjaminweb

Copy link
Copy Markdown
Contributor

Adds examples going through different flex box alignments and other characteristics.

This clarifies greatly for example how to use grow and space for vertical placement of elements.

(I realised this by working through https://css-tricks.com/snippets/css/a-guide-to-flexbox/)

Users benefit from this by copying and starting from a working example instead of fiddling around to find the (yet undocumented) solution for the required layout.

This is of course a working draft. Let me know what could be added.
Also, this could be used as template for defining vertical placement functions in atomic-css directly like center.

Screenshot 2026-10-05 at 22 17 33

@benjaminweb

Copy link
Copy Markdown
Contributor Author

/layout is now:

Screenshot 2026-10-06 at 15 40 45

@benjaminweb

Copy link
Copy Markdown
Contributor Author

/text is now:
IMG_8965
/whitespace-text is now:
IMG_8967

@seanhess

Copy link
Copy Markdown
Owner

The hope was that grow and space would allow users to do layouts without taking a flexbox tutorial. Seems like it failed for you?

Flexbox obviously has more capabilities, but the goal is to provide an easier interface. I'm thinking we should split the tutorial into two levels:

  1. First introduce layouts with space grow. Show how by nesting them you can accomplish arbitrary layouts.
  2. Lower down on the page, show advanced flexbox usage.

Would you like to work on that?

@benjaminweb

Copy link
Copy Markdown
Contributor Author

I am not sure. I don't feel that I understand it sufficiently enough to explain it by example heathers yet.

What wonders me specifically is the lack of a _center_ing function (like in Elm). To center with grow and space feels cumbersome to me - what is the right / idiomatic way to center horizontally and vertically?

@seanhess

seanhess commented Nov 4, 2026

Copy link
Copy Markdown
Owner

I'm going to merge this and introduce the space/grow stuff a little earlier. Thanks for doing it!

@seanhess
seanhess merged commit 39fe324 into seanhess:main Nov 4, 2026
2 checks passed
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.

2 participants