How to tint WebView text selection handles?

577 views Asked by At

im trying to tint the long press selection handles in the webview. I am doing it via the colorXYZ attributes in theme. Works for textView, however not for WebView, which stays default green / blue

This is what I have, none of the attributes work for webview

<style name="BaseTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/gold</item>
        <item name="colorControlActivated">@color/brown</item>
        <item name="colorButtonNormal">@color/gold</item>
</style>

enter image description here

::selection {
  background: #FFAABB;
}

This only colors the selection rect

enter image description here

1

There are 1 answers

9
Steven On

You need to do something like this with CSS.

::selection {
  background: #ffb7b7; 
}

You can find more info about it here