这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@AlexanderZeilmann
Copy link
Contributor

This pull request encompasses three closely related changes.
See the changes live here https://tailwind-nextjs-starter-blog-alexanderzeilmann.vercel.app/blog/github-markdown-guide

::before instead of :before

In CSS both ::before and :before work, but ::before is preferred.
Tailwind, however, accepts only the double-colon syntax, i.e. 'code:before': {content: 'none', }
has no effect at all in tailwind.config.js, but 'code::before': {content: 'none', } does.

Changes: Replace :before and :after by ::before and ::after

Rendering before the change:
colon_before
Rendering after the change:
colon_after

::marker additional to ::before in lists in CSS

Using the before-pseudo element to style the list-items seems to be not working in current browsers.
The new way is using the ::marker pseudo element.

Changes: Add the following in tailwind.css

.task-list-item {
  @apply list-none;
}

Rendering before the change (note the gray bullet-points):
before

Rendering after the change:
after

::marker in Tailwind

Tailwind uses the ::marker pseudo-element for styling lists.

Using

'ol li::before': {
  fontWeight: '600',
  color: theme('colors.gray.500'),
},

in tailwind.config.js does not overwrite the ::marker use by tailwind. For this we need:

'ol li::marker': {
  fontWeight: '600',
  color: theme('colors.gray.500'),
},

Changes: replace ol li:before and ul li:before by ol li::marker and ul li::marker in tailwind.config.js

@vercel
Copy link

vercel bot commented Dec 19, 2021

Someone is attempting to deploy a commit to a Personal Account owned by @timlrx on Vercel.

@timlrx first needs to authorize it.

@vercel
Copy link

vercel bot commented Dec 19, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/timlrx/tailwind-nextjs-starter-blog/4sAY7LJb2UNodJLEdUAsR17jxqBA
✅ Preview: https://tailwind-nextjs-starter-blog-git-fork-alexanderze-7aadc9-timlrx.vercel.app

@timlrx
Copy link
Owner

timlrx commented Dec 19, 2021

Thanks for spotting this! This must be due to the changes in tailwindcss-typography introduced during the upgrade to tailwind v3.

@timlrx timlrx merged commit e05191f into timlrx:master Dec 19, 2021
Meez25 pushed a commit to Meez25/Blog that referenced this pull request Jun 17, 2024
fix: use '::' for pseudo-classes & ::marker
bhiwagade-rahul pushed a commit to bhiwagade-rahul/tailwind-nextjs-starter-blog that referenced this pull request Sep 22, 2025
fix: use '::' for pseudo-classes & ::marker
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