Make tags and tag suggestions able to be styled by add-ons #2941
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.
I would like to extend Colorful Tags with the ability to also render user-selected tag colors in the editor. Right now this is not really possible as there is no stable & performant way to target individual tags and suggestion components.
This PR introduces two new data attributes,
data-suggestion
anddata-tag-name
that are applied to the corresponding elements, making them very easy to target via CSS or JS.A couple of thoughts:
data-addon
prefix, e.g.data-addon-tag
anddata-addon-suggestion
. That might be a more expressive way of highlighting that these are consumed by add-ons while also making it easier to grep for add-ons that might be accessing the attributes in the future. WDYT?&
and"
would be the spec-conformant way. However, it doesn't look like we're doing this anywhere else and in some places we already are setting some attributes to values that could contain both"
and&
(e.g.button.title
onTag.svelte
).