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

Fix Lists and upgrade List support to CSS3 #1161

Merged
merged 3 commits into from
Oct 21, 2022
Merged

Fix Lists and upgrade List support to CSS3 #1161

merged 3 commits into from
Oct 21, 2022

Conversation

Sub6Resources
Copy link
Owner

@Sub6Resources Sub6Resources commented Oct 8, 2022

The new CssBoxWidget allows us to effectively render a "marker box" on elements, especially list elements. This upgrade fixes almost all of our open list issues. It removes support for custom Widget list markers, since CSS doesn't support that (however, the same functionality could easily be re-added in a CustomRender by interested parties).

This pull request also removes the roman-numeral-specific numerus dependency in favor of the more general list_counter dependency (disclosure: package written by myself). This change in dependency allows us to expand our list style support to 54 different list-styles, including dozens of new languages.

This pull request fixes the following open and tightly-related issues:

Fixes #1100

Screen Shot 2022-10-08 at 2 55 19 PM

Fixes #245

Screen Shot 2022-10-08 at 2 58 22 PM

Fixes #984

Screen Shot 2022-10-08 at 3 00 37 PM

Fixes #991

Screen Shot 2022-10-08 at 3 02 01 PM

Fixes #1016

Screen Shot 2022-10-08 at 3 03 54 PM

Fixes #1020

Screen Shot 2022-10-08 at 3 08 53 PM

Fixes #1104

Screen Shot 2022-10-08 at 3 02 01 PM

This pull request is a work in progress ready to go. Still to do:

  • Re-add support for list-style-image.

erickok
erickok previously approved these changes Oct 9, 2022
Copy link
Collaborator

@erickok erickok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super work!

I will run on some examples, but the code looks solid.

@codecov
Copy link

codecov bot commented Oct 20, 2022

Codecov Report

Base: 49.70% // Head: 51.41% // Increases project coverage by +1.71% 🎉

Coverage data is based on head (91a7e70) compared to base (cb23cf0).
Patch coverage: 79.05% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1161      +/-   ##
==========================================
+ Coverage   49.70%   51.41%   +1.71%     
==========================================
  Files          18       19       +1     
  Lines        2682     2641      -41     
==========================================
+ Hits         1333     1358      +25     
+ Misses       1349     1283      -66     
Impacted Files Coverage Δ
lib/src/css_parser.dart 13.83% <0.00%> (+0.19%) ⬆️
lib/style.dart 85.36% <69.23%> (+0.59%) ⬆️
lib/src/css_box_widget.dart 64.28% <76.66%> (-0.19%) ⬇️
lib/html_parser.dart 83.96% <90.19%> (+10.61%) ⬆️
lib/custom_render.dart 50.96% <100.00%> (-0.62%) ⬇️
lib/src/style/marker.dart 100.00% <100.00%> (ø)
lib/src/styled_element.dart 80.21% <100.00%> (+1.06%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Sub6Resources Sub6Resources changed the title WIP: Fix Lists and upgrade List support to CSS3 Fix Lists and upgrade List support to CSS3 Oct 20, 2022
@Sub6Resources
Copy link
Owner Author

@erickok If you wouldn't mind doing a quick rereview on the most recent commit (which re-adds basic list-style-image support), that would be great. I also cleaned a few things up so there isn't as much repeated code.

@Sub6Resources Sub6Resources added this to the 3.0.0 milestone Oct 20, 2022
Copy link
Collaborator

@erickok erickok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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