Text strikethrough and underline colors #21667
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.
Objective
Allows users to override
TextColorand use a custom color for underline and strikethrough text decorations.Solution
New components
UnderlineColorandStrikethroughColor. Add them to a text entity withUnderlineorStrikethrough, respectively, to use a custom color for the lines.This could just be an optional color field on
UnderlineorStrikethrough, that would be fine. I spent a while going back and fourth about it. The main reasons why I went with a separate component:TextColoris going to be rare.The single component approach has some advantages too. Discoverability, obviously. Also compare:
with
which seems clearly nicer. If it weren't for the planned non-entity-local text styling support, I'd lean more towards the single component approach.
Testing
Added a few color overrides to this example:
Showcase