Skip to content

Commit

Permalink
fixup! fix(core): reset list count for sub-list items
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhg committed Sep 16, 2024
1 parent fa01a62 commit eb51fea
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,18 @@ export const EditableWrapper = styled(Card)<{$isFullscreen: boolean; $readOnly?:
margin-top: ${({theme}) => theme.sanity.space[2]}px;
}
/* Reset the list count if the element is not a numbered list item */
& > :not(.pt-list-item-number) {
counter-set: ${TEXT_LEVELS.map((l) => createListName(l)).join(' ')};
}
/* Reset the list count all the sub-list items */
& > .pt-list-item-number.pt-list-item-level-${TEXT_LEVELS[0]} {
counter-set: ${TEXT_LEVELS.slice(1)
.map((l) => createListName(l))
.join(' ')};
}
& > :not(.pt-list-item-number) {
counter-set: ${TEXT_LEVELS.map((l) => createListName(l)).join(' ')};
}
& > .pt-list-item + :not(.pt-list-item) {
margin-top: ${({theme}) => theme.sanity.space[3]}px;
}
Expand Down

0 comments on commit eb51fea

Please sign in to comment.