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

List item support #134

Merged
merged 23 commits into from
Sep 16, 2024
Merged

List item support #134

merged 23 commits into from
Sep 16, 2024

Conversation

cfraz89
Copy link
Contributor

@cfraz89 cfraz89 commented Sep 13, 2024

Implements support for list items. This is anything with css display: list-item, including naturally li's.
So far respects list-style-type:

  • disc (naturally in an ul),
  • decimal (naturally in an ol),
  • lower-alpha,
  • upper-alpha,
  • circle,
  • square.
  • disclosure-open
  • disclosure-closed

Handles nested lists.

Note that it breaks out inline_layout_data seperate from the NodeSpecificData enum, as at one point the list item data was implemented as NodeSpecificData too and needed to overlap with inline layout data, until i realised nodes such as input could also be display: list-item and so list-items also needed to be broken out. While inline_layout_data could be moved back into NodeSpecificData, I think it makes sense to leave it out, as afaik layout is independent of the tag type, and there will probably still be overlaps.

Whats missing so far:

  • Respecting li::marker, eg content, color.
  • Other list-style-types
  • Doesn't layout the same as browsers when <li> aren't nested in <ul> or <ol>, eg if they're nested in <div> instead. I can't quite reconcile how the browsers are behaving here, they compute the styling as list-style-position: outside but the layout seems to behave as if it's inside.

Demonstration has been added to text example.
image

@nicoburns nicoburns merged commit 0c49b8a into DioxusLabs:main Sep 16, 2024
8 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