Skip to content

How do you make a marker bold in a numbered list? #9119

Answered by wongjn
u01jmg3 asked this question in Help
Discussion options

You must be logged in to vote

If the rule is to apply globally, you could write that verbatim in your base @layer:

@tailwind base;
@tailwind component;
@tailwind utility;

@layer base {
  ol li:marker {
    font-weight: bold;
  }
}

See this Tailwind Play example


Otherwise, if it is styling for a particular <ol><li/></ol> element structure:

  • For ol li portion, we can use one of these arbitrary variants:
    1. [ol_&] if applying on to the lis
    2. [&_li] if applying on to the ol
    3. [&_ol_li] if applying on to some parent container
  • For ::marker portion, we can use the marker variant
  • For font-weight: bold, we use the font-bold utility

This results in:

  1. <div class="pl-5">
      <ol class="list-decimal">
        <li class="[ol_&]:marker:fo…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@u01jmg3
Comment options

Answer selected by u01jmg3
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants