Make list type selector case sensitive #2418
Merged
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.
What are you trying to accomplish?
This is a follow-up to #2305 and closes #2406 by making the list type selector case sensitive.
Example code
rendered:
What approach did you choose and why?
The problem was that the
ol[type='A']
selector overrides theol[type='a']
since it comes after in the source order.css/src/markdown/lists.scss
Lines 17 to 23 in e631273
Adding
s
to the selector (ol[type='A' s]
) makes it case sensitive, so the order doesn't matter anymore. Used this 👀 Codepen to test. Note that MDN says the case-sensitive modifier (s
) is not widely supported yet, but tested in Chrome, Edge, Firefox, Safari and they all seem to work. Maybe the MDN table is just not updated yet? 🤔What should reviewers focus on?
I was wondering why we even need these styles and couldn't just use the browser default. But I assume they are needed because we have some opinionated way when nesting lists:
css/src/base/typography-base.scss
Lines 49 to 59 in e631273
Can these changes ship as is?