[go: nahoru, domu]

Skip to content
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

Allow customizing highlight style #143

Closed
NickColley opened this issue Aug 31, 2020 · 6 comments
Closed

Allow customizing highlight style #143

NickColley opened this issue Aug 31, 2020 · 6 comments

Comments

@NickColley
Copy link

It would be great to be able to style the highlight as the bright yellow may not meet accessibility requirements for certain pages.

See also: #142

@Treora
Copy link
Contributor
Treora commented Sep 2, 2020

To allow customisation, perhaps some kind of remix of the CSS :target and ::selection pseudo-class/element could be an option? (issue #1 seems related but different)

But I’d think that ideally website publishers should not need to customise their site for accessibility: a user agent could just adjust the highlight colour to ensure sufficient contrast; just like some browsers (at least Firefox, but not Chromium I now discover) invert the colours of the user’s selection on dark-ish backgrounds.

@bokand
Copy link
Collaborator
bokand commented Sep 16, 2020

Styling the highlight color is under discussion in w3c/csswg-drafts#5233

@bokand
Copy link
Collaborator
bokand commented Sep 16, 2020

Regarding accessibility requirements, the browser should provide good defaults. Chrome's reusing the indicating infrastructure that exists around Find-In-Page. I think Chrome could be improved in this case (e.g. crbug/39077. The highlight for text-fragments specifically is currently being debated but this should be implementation defined behavior (certainly warrants some discussion in spec though).

@chrishtr
Copy link

See also issue w3c/csswg-drafts#5522 which is specifically for text fragments.

@bokand
Copy link
Collaborator
bokand commented Nov 25, 2020

Update: This has been implemented and is proposed for shipping in blink-dev

@bokand bokand changed the title Styling Allow customizing highlight style Nov 25, 2020
@bokand
Copy link
Collaborator
bokand commented Dec 21, 2022

The ::target-text pseudo has been shipping for a while now so this is resolved.

@bokand bokand closed this as completed Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants