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

Fixed @left-* parsing #342

Merged
merged 4 commits into from
Jan 13, 2025
Merged

Fixed @left-* parsing #342

merged 4 commits into from
Jan 13, 2025

Conversation

Andarist
Copy link
Collaborator

fixes #341

@Andarist Andarist requested a review from thysultan January 12, 2025 19:45
@coveralls
Copy link

Pull Request Test Coverage Report for Build 12736556494

Details

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 98.613%

Totals Coverage Status
Change from base Build 10510962967: 0.01%
Covered Lines: 288
Relevant Lines: 291

💛 - Coveralls

if (charat(characters, 3) === 110) break
// l(ayer)
case 108:
if (charat(characters, 2) === 97) break
default:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is a default case that's not the last one 😅 I tried to code-golf this as much as possible and this is my best version so far

I was testing the size increase on dist/umd/stylis.js (since it's already minified) using wc -c and gzip -c | wc -c. Those are results:

ref wc -c gzip -c | wc -c
master 10571 4396
9c57efb 10607 4413
2a519d3 10619 4409
ebd509a 10606 4406

Copy link
Collaborator Author

@Andarist Andarist Jan 12, 2025

Choose a reason for hiding this comment

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

The idea behind the fix here is that for non-layer and non-container (this case was already covered) we "reset" offset. We do the same in the default case and that's why the code falls through from those when it doesn't break

Then based on the offset (if it survived or not) the correct parsing invocation is selected

@Andarist Andarist merged commit 2acb35b into thysultan:master Jan 13, 2025
1 check passed
@Andarist Andarist deleted the fix/page-left branch January 13, 2025 05:55
@Andarist Andarist restored the fix/page-left branch January 13, 2025 05:55
@Andarist Andarist deleted the fix/page-left branch February 6, 2025 10:47
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.

@left-bottom rule produces incorrect output
3 participants