Skip to content

Ordered lists start from 2 #162

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

Closed
simonacca opened this issue Apr 8, 2021 · 8 comments
Closed

Ordered lists start from 2 #162

simonacca opened this issue Apr 8, 2021 · 8 comments

Comments

@simonacca
Copy link

What version of @tailwindcss/typography are you using?

v0.4.0

What version of Node.js are you using?

none

What browser are you using?

Google Chrome 85.0.4183.121

What operating system are you using?

Ubuntu 20.10

Reproduction repository

https://www.youtube.com/watch?v=-6BsiVyC1kM

@simonacca
Copy link
Author

simonacca commented Apr 8, 2021

image

As you can see in the snapshot from here, the first element of an ordered list is marked as "2." when it should be "1."

@adamwathan
Copy link
Member

Hmm I can't reproduce in any browser on macOS, wonder if this is somehow specific to Ubuntu or something else?

image

@simonacca
Copy link
Author

Interesting, will try different browser/os combo and report back

@simonacca
Copy link
Author

What I learned so far:

  • can't reproduce in chrome/edge on windows
  • can't reproduce on firefox 80.0.1 on ubuntu 20.10

Also, the issue is fixed in chrome by adding counter-reset: list-item; to ol.

simonacca added a commit to simonacca/tailwindcss-typography that referenced this issue Apr 9, 2021
@pmh722
Copy link

pmh722 commented Oct 9, 2021

I can reproduce on Ubuntu. Bug appears in Chromium but not Firefox. Tailwind Typography version 0.4.1

The counter-reset fix worked for me. Thanks @simonacca !

@pmh722
Copy link

pmh722 commented Oct 11, 2021

I can reproduce on Ubuntu. Bug appears in Chromium but not Firefox. Tailwind Typography version 0.4.1

The counter-reset fix worked for me. Thanks @simonacca !

HOWEVER, counter-reset causes the list to start at 0 on Safari....

@farishubton
Copy link

+1, same here.

Device: Vivo 1808 Build/O11019
Google Chrome Version: 70.0.3538.110
OS: Android 8.1.0

@reinink
Copy link
Member

reinink commented Jan 7, 2022

Hey! We recently did a major update to the typography plugin, and one of the bigger changes was simplifying the ordered list implementation. We're no longer using pseudo elements to render the counter, but instead are just relying on the default browser list marker implementation.

Before:

'ol > li::before': {
content: 'counter(list-item, var(--list-counter-style, decimal)) "."',
position: 'absolute',
fontWeight: '400',
color: theme('colors.gray.500', defaultTheme.colors.gray[500]),
},

After:

'ol > li::marker': {
fontWeight: '400',
color: 'var(--tw-prose-counters)',

I suspect that this will resolve this issue, so I'm going to close this. Please report back if that's not the case 👍

@reinink reinink closed this as completed Jan 7, 2022
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 a pull request may close this issue.

5 participants