You can use two ways to change the default Readabler script styles settings :
way 1 (preferred)
Add the styles to <head> </head>of index.html like in the example below
<style>
:root {
--readabler-bg: #ffffff;
}
</style>
way 2
Add the new options via Readabler script. In the example below, the background color is specified via '--readabler-bg': 'green'.
<script>
window.addEventListener(
'DOMContentLoaded',
() => {
const readabler = new Readabler(
options,
{
'--readabler-bg': 'green'
}
);
}
);
</script>
Available Readabler script styles options
Popup styles
| Option | Default value | Description |
| –readabler-bg | #ffffff | The background color of the popup for the day(light) theme. |
| –readabler-bg-dark | #16191b | The background color of the popup for the night(dark) theme. |
| –readabler-text | #333 | The text color of the popup for the day(light) theme. |
| –readabler-text-dark | #deeffd | The text color of the popup for the night(dark) theme. |
| –readabler-color | rgba(33, 150, 243, 1) | The base color of the popup for the day(light) theme. |
| –readabler-color-dark | rgba(33, 150, 243, 1) | The base color of the popup for the night(dark) theme. |
| –readabler-color-transparent | rgba(33, 150, 243, .2) | The color transparent of the popup for the day(light) theme. |
| –readabler-color-transparent-dark | rgba(222, 239, 253, .2) | The color transparent of the popup for the night(dark) theme. |
| –readabler-border-radius | 20px | The border-radius of the popup. |
| –readabler-animate | 600ms | The animation duration of the popup appears. |
Readabler script popup stylesOverlay styles
| Option | Default value | Description |
| –readabler-overlay | rgba(2, 83, 238, .5) | The overlay background color. |
Open button styles
| Option | Default value | Description |
| –readabler-btn-margin | 10px | The margin of the button. You can set the value from 0 to 100 pixels. |
| –readabler-btn-padding | 20px | The padding of the button. You can set the value from 0 to 100 pixels. |
| –readabler-btn-radius | 50px | The border-radius of the button. |
| –readabler-btn-color | #ffffff | The text/icon color of the button. |
| –readabler-btn-color-hover | rgba(33, 150, 243, 1) | The hover text/icon color of the button. |
| –readabler-btn-bg | rgba(33, 150, 243, 1) | The background color of the button. |
| –readabler-btn-bg-hover | #ffffff | The hover background color of the button. |
| –readabler-btn-size | 24px | The button size. |
| –readabler-btn-delay | 0s | The delay before the button appears on the page. |
Virtual Keyboard styles
| Option | Default value | Description |
| –readabler-keyboard-light-bg | #ececec | The background color of the virtual keyboard for the day(light) theme. |
| –readabler-keyboard-light-key-bg | #ffffff | The button’s background of the virtual keyboard for the day(light) theme. |
| –readabler-keyboard-light-key | #111111 | The buttons text color of the virtual keyboard for the day(light) theme. |
| –readabler-keyboard-dark-bg | #000000CC | The background color of the virtual keyboard for the night(dark) theme.. |
| –readabler-keyboard-dark-key-bg | rgba( 0, 0, 0, .5 ) | The button’s background of the virtual keyboard for the night(dark) theme. |
| –readabler-keyboard-dark-key | #ffffff | The buttons text color of the virtual keyboard for the night(dark) theme. |
Text Magnifier options
| Option | Default value | Description |
| –readabler-text-magnifier-bg-color | #333333 | The background color of the magnifier. |
| –readabler-text-magnifier-color | #ffffff | The font color of the magnifier. |
| –readabler-text-magnifier-font-size | 36px | The font size of the magnifier. |
Highlight Titles styles
| Option | Default value | Description |
| –readabler-highlight-titles-style | solid | The border style of the highlighted title. Values: none, dotted, dashed, solid, double, groove, ridge, inset, outset |
| –readabler-highlight-titles-color | #639af9 | The border color of the highlighted title. |
| –readabler-highlight-titles-width | 2px | The border width of the highlighted title. |
| –readabler-highlight-titles-offset | 2px | The border offset of the highlighted title. |
Highlight Links styles
| Option | Default value | Description |
| –readabler-highlight-links-style | solid | The border style of the highlighted links. Values: none, dotted, dashed, solid, double, groove, ridge, inset, outset |
| –readabler-highlight-links-color | #639af9 | The border color of the highlighted links. |
| –readabler-highlight-links-width | 2px | The border width of the highlighted links. |
| –readabler-highlight-links-offset | 2px | The border offset of the highlighted links. |
Highlight Hover styles
| Option | Default value | Description |
| –readabler-highlight-hover-style | solid | The border style on hover content. Values: none, dotted, dashed, solid, double, groove, ridge, inset, outset |
| –readabler-highlight-hover-color | #639af9 | The border color on hover content. |
| –readabler-highlight-hover-width | 2px | The border width on hover content. |
| –readabler-highlight-hover-offset | 2px | The border offset on hover content. |
Highlight Focus styles
| Option | Default value | Description |
| –readabler-highlight-focus-style | solid | The border style on focus content. Values: none, dotted, dashed, solid, double, groove, ridge, inset, outset |
| –readabler-highlight-focus-color | #639af9 | The border color on focus content. |
| –readabler-highlight-focus-width | 2px | The border width on focus content. |
| –readabler-highlight-focus-offset | 2px | The border offset on focus content. |
Reading Guide styles
| Option | Default value | Description |
| –readabler-reading-guide-width | 500px | The width of the line guide. |
| –readabler-reading-guide-height | 17px | The height of the line guide. |
| –readabler-reading-guide-radius | 10px | The border-radius of the line guide. |
| –readabler-reading-guide-bg | #0274e6 | The background color of the line. |
| –readabler-reading-guide-border-width | 7px | The border width of the line guide. |
| –readabler-reading-guide-border-color | #000000 | The border color of the line guide |
| –readabler-reading-guide-arrow | 10px | The arrow size of the line guide. |
| –readabler-reading-guide-arrow-margin | -10px | The arrow margin of the line guide. |
Reading mask style
| Option | Default value | Description |
| –readabler-reading-mask | rgba(0, 0, 0, 0.7) | The overlay color of reading mask. |
Text to speech styles
| Option | Default value | Description |
| –readabler-tts-bg | rgba(33, 150, 243, 1) | The background color of text to speech button. |
| –readabler-tts-color | rgba(255, 255, 255, 1) | The text/icon color of text to speech button. |
Was this article helpful to you?