Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #383
Description
A ticking
format="duration"/format="elapsed"element visibly jumps around as it counts, because proportional digits change width between ticks. The renderedspan[part="root"]now getsfont-variant-numeric: tabular-numsfor those two formats, following the write-skipping pattern of#updateRenderRootContent— the inline style is only written when its value actually changes, so the periodic-tick fast path is untouched.::part(root) { font-variant-numeric: normal !important }(an author!importantrule beats a non-important inline style).Of the two shapes discussed in the issue (document a user-side rule vs make it the default), this makes it the default for the ticking formats only — the timer jumping is visible out of the box, while date/relative typography is unchanged.
Verification
npx web-test-runner— 640 passed, 0 failed, including two new tests: one assertsdurationandelapsedrender withtabular-numsand another asserts other formats get no inline numeric styling; without the change the first fails withexpected '' to equal 'tabular-nums'npx tsc --noEmitandnpx eslint src/relative-time-element.ts test/relative-time.js— clean