All Projects → brettgullan → tailwindcss-scrims

brettgullan / tailwindcss-scrims

Licence: other
Configurable Tailwind plugin for generating scrim classes.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to tailwindcss-scrims

tailwindcss-background-extended
All of the missing background utilities for Tailwind CSS.
Stars: ✭ 25 (-28.57%)
Mutual labels:  tailwind, tailwind-css, tailwindcss-plugin
tailwind-color-alpha
Automatic alpha variants for your Tailwind CSS colors based on your opacity config
Stars: ✭ 21 (-40%)
Mutual labels:  tailwind, tailwind-css, tailwindcss-plugin
code-type
Practice code-typing with top 1000 keywords of the most popular programming languages.
Stars: ✭ 31 (-11.43%)
Mutual labels:  tailwind, tailwind-css
notus-js
Notus JS: Free Tailwind CSS UI Kit and Admin
Stars: ✭ 191 (+445.71%)
Mutual labels:  tailwind, tailwind-css
admin-one-vue-tailwind
Free Vue.js 3.x Tailwind 3.x admin dashboard template with dark mode. Vite builds. Pinia state. Laravel integration available
Stars: ✭ 742 (+2020%)
Mutual labels:  tailwind, tailwind-css
svelte-pwa-now
A PWA ready Svelte v3.0 starter template with Tailwind, Now integration and optional Typescript suppot
Stars: ✭ 138 (+294.29%)
Mutual labels:  tailwind, tailwind-css
covid-19-stats
Get the latest COVID-19 statistics by country
Stars: ✭ 41 (+17.14%)
Mutual labels:  tailwind, tailwind-css
axiom
Axiom - A Hugo Theme. GitTip: https://gitcoin.co/tip?username=jhauraw
Stars: ✭ 67 (+91.43%)
Mutual labels:  tailwind, tailwind-css
Next-JS-Landing-Page-Starter-Template
🚀 Free NextJS Landing Page Template written in Tailwind CSS 3 and TypeScript ⚡️ Made with developer experience first: Next.js 12 + TypeScript + ESLint + Prettier + Husky + Lint-Staged + VSCode + Netlify + PostCSS + Tailwind CSS
Stars: ✭ 521 (+1388.57%)
Mutual labels:  tailwind, tailwind-css
tailwind
Website clones/examples using Tailwind CSS.
Stars: ✭ 49 (+40%)
Mutual labels:  tailwind, tailwind-css
create-nuxt-tailwind-app
[DEPRECATED] Use create-nuxt-app, they added full tailwindcss & purgecss support
Stars: ✭ 32 (-8.57%)
Mutual labels:  tailwind, tailwind-css
tailwind-shift
⚙️ Shift to the next TailwindCSS version hassle-free.
Stars: ✭ 114 (+225.71%)
Mutual labels:  tailwind, tailwind-css
github-markdown-tailwindcss
⛵ Replicate GitHub Flavored Markdown with Tailwind CSS components
Stars: ✭ 100 (+185.71%)
Mutual labels:  tailwind, tailwind-css
tailwind-dashboard-template
Mosaic Lite is a free admin dashboard template built on top of Tailwind CSS and fully coded in React. Made by
Stars: ✭ 1,662 (+4648.57%)
Mutual labels:  tailwind, tailwind-css
movie-app
🌈 TMDB + Laravel + LiveWire + AlpineJS + ViewModels + Components = ❤️ Movies App 🔥
Stars: ✭ 43 (+22.86%)
Mutual labels:  tailwind-css, tailwindcss-plugin
Twin.macro
🦹‍♂️ Twin blends the magic of Tailwind with the flexibility of css-in-js (emotion, styled-components, stitches and goober) at build time.
Stars: ✭ 5,137 (+14577.14%)
Mutual labels:  tailwind, tailwind-css
notus-angular
Notus Angular: Free Tailwind CSS UI Kit and Admin
Stars: ✭ 148 (+322.86%)
Mutual labels:  tailwind, tailwind-css
tailwind-ui-components
Free Tailwind CSS UI Components - Crafted for modern websites, landing pages and web apps. TailGrids Core is free and open-source so, feel free to use with your personal or commercial projects. If you would like to show your support and love, don't forget to give us a star 🌟
Stars: ✭ 49 (+40%)
Mutual labels:  tailwind, tailwind-css
cra-tailwindcss
Integrate Tailwind CSS in a Create React App setup
Stars: ✭ 105 (+200%)
Mutual labels:  tailwind, tailwind-css
windstrap
Tailwind CSS with Bootstrap JS
Stars: ✭ 63 (+80%)
Mutual labels:  tailwind, tailwindcss-plugin

Tailwind CSS Scrims

Configurable Tailwind plugin for generating scrim utility classes.

What are Scrims?

In photography, a scrim is something that softens light — from the sun, or a flash — and is typically a piece of fabric, paper or acrylic stretched across a frame.

In UX, a scrim is a design technique (a gradient or overlay) used to make text more legible when overlaid on an image. The kind of visual treatment that is becoming increasingly common in card-based design.

A typical scrim is a neutral gradient that starts about half-way down an image and increases to 30%-40% opacity, creating a subtle darkening effect that provides enought contrast for white text to be legible.

Install

tailwindcss-scrims automatically generates generates scrim class variations for specified directions, distances and gradient densities.

npm install --save-dev tailwindcss-scrims

Usage

// tailwind.js
module.exports = {
  // ...
  plugins: [
    require('tailwindcss-scrims')({
      directions: {
        't': 'to bottom',
        'b': 'to top',
        'r': 'to left',
        'l': 'to right',
      },
      distances: {
        '1/4': '25%',
        '1/3': '33.33333%',
        '1/2': '50%',
        '2/3': '66.66666%',
        '3/4': '75%',
      },
      colors: {
        default: [rgba(0,0,0,0.4), rgba(0,0,0,0)],
      },
      variants: ['responsive', 'hover'],
    })
  ]
  // ...
}

Options

directions (optional)

Default:

{
  't': 'to bottom',
  'b': 'to top',
  'r': 'to left',
  'l': 'to right',
}

This is where you can define the direction — or location of emphasis — for a scrim. i.e. where the scrim color is darkest. Each direction is specified as a key/value pair. The key is used in the utility class name, the value is a valid CSS Gradient direction.

distances (optional)

Default:

{
  '1/4': '25%',
  '1/3': '33.33333%',
  '1/2': '50%',
  '2/3': '66.66666%',
  '3/4': '75%',
}

This defines the distance the scrim covers. i.e. how much of the image is covered by the scrim gradient. Each distance is specified as a key/value pair. The key is used in the utility class name, the value is a valid CSS Gradient 'stop' location.

colors (optional)

Default:

{
  default: [rgba(0,0,0,0.4), rgba(0,0,0,0)],
}

colors define the {start} and {end} colors (including alpha) for a scrim.

variants (optional)

Default:

['responsive', 'hover']

As per the tailwind plugin docs you can also pass variants (responsive, hover, etc.) as an option.

require('tailwindcss-scrims')({
  variants: ['responsive', 'hover'],
})

Example

This configuration:

// tailwind.js
module.exports = {
  // ...
  plugins: [
    require('tailwindcss-scrims')({
      directions: {
        't': 'to bottom',
        'b': 'to top',
      },
      distances: {
        default: '25%',
        '1/2': '50%',
      },
      colors: {
        default: [rgba(0,0,0,0.4), rgba(0,0,0,0)],
      },
      variants: [],
    })
  ]
  // ...
}

Results in the following utilities:

.scrim-t::after: {
  content: " ",
  position: absolute,
  top: 0,
  left: 0,
  width: 100%,
  height: 100%,
  backgroundImage: linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0) 25%);
}

.scrim-t-1\/2::after: {
  content: " ",
  position: absolute,
  top: 0,
  left: 0,
  width: 100%,
  height: 100%,
  backgroundImage: linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0) 50%);
}

.scrim-b::after: {
  content: " ",
  position: absolute,
  top: 0,
  left: 0,
  width: 100%,
  height: 100%,
  backgroundImage: linear-gradient(to top, rgba(0,0,0,0.4), rgba(0,0,0,0) 25%);
}

.scrim-b-1\/2::after: {
  content: " ",
  position: absolute,
  top: 0,
  left: 0,
  width: 100%,
  height: 100%,
  backgroundImage: linear-gradient(to top, rgba(0,0,0,0.4), rgba(0,0,0,0) 50%);
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].