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

Incorrect numbering display in an ordered list. #517

Open
u4aew opened this issue Dec 4, 2024 · 1 comment
Open

Incorrect numbering display in an ordered list. #517

u4aew opened this issue Dec 4, 2024 · 1 comment

Comments

@u4aew
Copy link
Contributor

u4aew commented Dec 4, 2024

Current Issue:

When typing a number, the ordered list's numbering gets misaligned.

Expected Outcome:

Correct display of numbers in the list.

14.5.1

demo-1.mp4
@karisDev
Copy link

karisDev commented Dec 18, 2024

It seems like a CSS issue, counter has a default padding which cant have auto width. But I was able to fix this in a very bad way by customizing display property:

ol {
  display: grid;
  padding-left: 0;
  grid-template-columns: max-content 1fr;
  align-items: center;
  counter-reset: grid-ol-counter 9998;
}

ol li {
  display: contents;
}

ol li::before {
  counter-increment: grid-ol-counter;
  text-align: right;
  display: inline;
  content: counter(grid-ol-counter) ". ";
}

Before:
CleanShot 2024-12-18 at 12 50 00

The result:
CleanShot 2024-12-18 at 12 49 15

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

No branches or pull requests

2 participants