tailwindcss-selection-variant weekly downloads statistics
By philippbosch (4 listings) · npm · Tailwind plugins
Adds a variant for selected text (::selection) to Tailwind CSS
tailwindcss-selection-variant has 160 recorded weekly downloads on npm, a decrease of 24.2% over the past 30 days, ranking #2539 of 3,247 tracked listings.
About tailwindcss-selection-variant
tailwindcss-selection variant
Adds a variant for targeting user-selected text ranges (::selection) to Tailwind CSS.
Example
Given this HTML:
<div class="selection:bg-red-500 selection:text-white">
Lorem ipsum dolor sit amet
</div>
If the user selects parts of the text within this <div> the selection highlight rendered by the browser will be white text on red background.
This is the relevant part of the generated CSS (simplified):
.selection\:bg-red-500 ::selection {
background-color: #f56565;
}
.selection\:text-white ::selection {
color: #fff;
}
Requirements
This plugin requires Tailwind CSS v1.x.
Installation
npm install --save-dev tailwindcss-selection-variant
or
yarn add --dev tailwindcss-selection-variant
Usage
In your tailwind.config.js:
module.exports = {
// …
plugins: [
// …
require("tailwindcss-selection-variant")
// …
],
variants: {
textColor: [
// …
'selection',
],
backgroundColor: [
// …
'selection',
],
}
// …
};
Note
Not all CSS properties (and thus Tailwind utilities) can be used with ::selection. See the list of allowable properties on MDN
License
Description from the npm listing.
- tailwindcss
- tailwindcss-plugin
- selection
- text selection
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm Tailwind plugins plugins
All 20 tailwindcss-selection-variant alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/tailwindcss-selection-variant. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.