Skip to content
Discussion options

You must be logged in to vote

No, there is no looping with CSS.

Assuming the app-task-progress-* class is added dynamically, I'd suggest using a style attribute alongside to set a CSS variable like:

<tr class="app-task-progress-50" style="--progress: 50%">
  <td class="first:after:w-(--progress)">

Otherwise, you could define a @utility with @source inline to emulate a loop:

@utility app-task-progress-* {
  td:first-child::after {
    width: calc(--value(integer) * 1%);
  }
}

@source inline("app-task-progress-{0..100..5}");

Replies: 2 comments 1 reply

Comment options

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

Answer selected by FabianoLothor
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