You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

tailwindcss-scrim-gradients

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tailwindcss-scrim-gradients

Gradient scrim overlays are a common pattern employed to preserve legibility of text, or to suggest further content out-of-bounds. These utilities allow you to pair an edge or axis with a distance value, and produce an eased gradient overlay: `scrim-b-12`

0.3.1
latest
Source
npmnpm
Version published
Weekly downloads
7
-70.83%
Maintainers
1
Weekly downloads
 
Created
Source

Tailwind CSS Scrim Gradients

Gradient scrim overlays are a common pattern employed to preserve legibility of text, or to suggest further content out-of-bounds. These utilities allow you to pair an edge or axis with a distance value, and produce an eased gradient overlay: scrim-b-12.

  • Uses theme scales for color and distance values
  • Multiple edges can be specified and overriden
  • Allows the use of opacity modifiers without stacking conflicts
  • Easing subdues appearance of hard edges when gradient begins

Installation

Install the plugin:

npm install -D tailwindcss-scrim-gradients

Then add it to your tailwind.config.js file:

// tailwind.config.js
module.exports = {
	theme: {
		// ...
	},
	plugins: [
		require('tailwindcss-scrim-gradients'),
		// ...
	],
};

Usage

Combine color and distance utilities to generate a scrim:

<div class="scrim-b-16 dark:scrim-black/70">
	<!-- ... -->
</div>

Shorthand utilities work exactly as you would expect:

<div class="scrim-20 scrim-x-12 scrim-r-0">
	<!-- ... -->
</div>

Caveats

The scrim uses the ::after pseudo-element to apply the overlay, and can not be used with the respective Tailwind variants. This also means that the containing element will default to relative positioning. Whatever position value you set will be respected, so long as you do not specify 'static'.

Gradient stacking is achieved through mask-image, which has good browser support when used with PostCSS plugins such as autoprefixer.

Keywords

tailwind

FAQs

Package last updated on 01 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.