custom selection

V1.1.3

Making Text Selection Sexy
Using Attributes

A selection library built using JavaScript. It provides custom text selection with support for color, background-color.
01

Background Color

The text selector background color can be set to any RGB or hex value using the
data-selection-color can change the background color

02

Text Color

The text selector text color can be set to any RGB or hex value using the
data-selection-text-color can change the background color

source: sciencemuseum.org
03

Text Stroke

The text selector text stroke is set using data-selection-text-stroke attribute this adds text strokes to elements. To set the stroke color use data-selection-text-stroke-color this takes any hex or RGB value. To set the stroke width use data-selection-text-stroke-width . Important to note this does require the units to be specified after eg data-selection-text-stroke-width="2rem". To set the fill color use data-selection-text-stroke-fill-color**
** Text Stroke is not available yet

source: Good House Keeping.
04

Text Decoration

The text selector text decoration is set using data-selection-text-decoration attribute this adds text decoration to elements. To set the decoration color use data-selection-text-decoration-color this takes any hex or RGB value. To set the decoration line use data-selection-text-decoration-line. To set style use data-selection-text-decoration-style. To set decoration thickness use data-selection-text-decoration-thickness**
** Text Decoration is not available yet

source: Insider

Ready
Make Your
Text Selection Sexy As F*ck

Github

Check out Custom Selection

We are always looking for suggestions to help this library grow.

Visit the GitHub repository page for a complete introduction and list of available options. Search the GitHub issue tracker carefully to check if your issue/feature has already been reported/requested before opening a new issue or submitting a pull request.

Check out on GitHub
Install Using jsdelivr
Read Docs
Magic Selection - 🔮 Adds CSS Selection using data attributes | Product Hunt

Properties Used

attribute
value
data-selection
true
data-selection-color
#f7f33a
data-selection-text-color
#cba6d6

Let's Make Something
Great