html - Determine browser's default text highlight color using JavaScript or Dart -


the browser's default text highlight (selection) background color can overridden, e.g.:

::selection {   background: #ffb7b7; } 

and the color browser/os specific. there way read browser's default value using javascript or dart?

i can't.

both getcomputedstyle(yourelement, '::selection').backgroundcolor , getcomputedstyle(yourelement, '::-moz-selection').backgroundcolor return transparent default value , browser won't override os's default.
(worth mentioned if you set transparent, default os' value overriden).

i don't think browsers have access os default preferences, , if do, won't let website access it easily.


Comments

Popular posts from this blog

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -