-
Notifications
You must be signed in to change notification settings - Fork 657
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
[css-highlight-api] Need clarification on expected default values for style properties #6375
Comments
Since ::highlight targets author-defined highlights rather than UA-defined highlights, I don't think UAs should define any styles for ::highlight in their default stylesheets. It's also actually not possible to do this since ::highlight requires a highlight name to be passed and there's no way to write a rule that targets all ::highlight pseudos. The default styles should just be inherited from the originating element. I do agree that we should mention this explicitly in the spec though. |
The CSS Working Group just discussed
The full IRC log of that discussion<fantasai> Topic: highlights and default values for styles<Rossen_> ack emilio <fantasai> github: https://github.com//issues/6417 <fantasai> github: https://github.com//issues/6375 <fantasai> dandclark: CSS Pseudo specifies default values for certain native highlights. Should there be any defaults for custom highlights? <fantasai> dandclark: Since these are author-defined highlight, don't think should define any styles in UA styles <fantasai> dandclark: also no way to do this <fantasai> dandclark: Seems better to let it just inherit from originating element <fantasai> dandclark: Might want to make explicit that UA should not give default styles <sanketj> s/dandclark/sanketj <TabAtkins> fantasai: I agree with this <fantasai> s/dandclark/sanketj <fantasai> s/dandclark/sanketj <fantasai> s/dandclark/sanketj <fantasai> fantasai: Doesn't make any sense for UA to add default styles to custom highlights <fantasai> Rossen_: Any objections? <fantasai> RESOLVED: UA does not add any default styles to custom highlights |
This issue requires an update to the spec, which is still pending. Leaving this open till that has landed. |
I didn't find any statement on default values for style properties of ::highlight in the spec draft. There are some default values in the spec for pseudos but ::highlight is not in the list. Also in the spec draft of ::highlight there's no mention of it.
Should it use no visual effects or should it use for example Highlight/HighlightText colors instead? I assume it's taking no visual effects as default values (as in when background-color is not specified inside a ::highlight(foo) then the content's background is the same as if there was no ::highlight defined), but maybe it should be explicitly stated?
The text was updated successfully, but these errors were encountered: