mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
1.3 KiB
1.3 KiB
| extends | title | description | features | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| _layouts.documentation | User Select | Utilities for controlling whether the user can select text in an element. |
|
@include('_partials.work-in-progress')
@include('_partials.class-table', [ 'rows' => [ [ '.select-none', 'user-select: none;', "Disable selecting text in an element.", ], [ '.select-text', 'user-select: text;', "Allow selecting text in an element.", ], ] ])
Customizing
Responsive, Hover, and Focus Variants
By default, only responsive variants are generated for user select utilities.
You can control which variants are generated for the user select utilities by modifying the userSelect property in the modules section of your Tailwind config file.
For example, this config will also generate hover and focus variants:
{
// ...
modules: {
// ...
userSelect: ['responsive', 'hover', 'focus'],
}
}
Disabling
If you aren't using the user select utilities in your project, you can disable them entirely by setting the userSelect property to false in the modules section of your config file:
{
// ...
modules: {
// ...
userSelect: false,
}
}