User Select

Set the ability for users to select text in an element.

Limited availability

This feature does not work in some of the most widely-used browsers.

Chrome
Edge
Firefox
Safari

Usage

Auto

Allow the browser to determine the default highlighting behavior.

Try selecting the sentence to see how the text highlighting works.
Sphinx of black quartz, judge my vow.
<p class="c-slate fs-lg us-auto">Sphinx of black quartz, judge my vow.</p>

All

Allow the user to select all text within the element.

Sphinx of black quartz, judge my vow.
<p class="c-slate fs-lg us-a">Sphinx of black quartz, judge my vow.</p>

None

Prevent the user from selecting any text within the element.

Sphinx of black quartz, judge my vow.
<p class="c-slate fs-lg us-none">Sphinx of black quartz, judge my vow.</p>

Text

Allow the user to select text within the element.

Sphinx of black quartz, judge my vow.
<p class="c-slate fs-lg us-t">Sphinx of black quartz, judge my vow.</p>

Responsiveness

Use breakpoint prefixes to target different screen sizes. Styles apply from the breakpoint & up.

Target viewport sizes with breakpoint prefixes.

sm:us-*
Small640px
md:us-*
Medium768px
lg:us-*
Large1024px
xxl:us-*
Extra Large1536px

Hover State

Apply styles conditionally on hover using the h: prefix.

Add the h: prefix to apply styles only when the user hovers over the element.

Syntax:h:us-*