Skip to content
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

fix(core): correctly reset PTE list counts after non-numbered lists and in sublists #7506

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export const EditableWrapper = styled(Card)<{$isFullscreen: boolean; $readOnly?:
& > .pt-list-item-bullet + .pt-list-item-number,
& > .pt-list-item-number + .pt-list-item-bullet {
margin-top: ${({theme}) => theme.sanity.space[3]}px;
counter-reset: ${TEXT_LEVELS.map((l) => createListName(l)).join(' ')};
}

& > :not(.pt-list-item) + .pt-list-item {
Expand All @@ -107,13 +106,12 @@ export const EditableWrapper = styled(Card)<{$isFullscreen: boolean; $readOnly?:
counter-set: ${TEXT_LEVELS.map((l) => createListName(l)).join(' ')};
}

${TEXT_LEVELS.slice(1).map((l) => {
return css`
& > .pt-list-item-level-${l} + .pt-list-item-level-${l - 1} {
counter-reset: ${createListName(l)};
}
`
})}
/* 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(' ')};
}

& > .pt-list-item + :not(.pt-list-item) {
margin-top: ${({theme}) => theme.sanity.space[3]}px;
Expand Down
Loading