npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@josephmark/tailwind-plugins

v1.1.0

Published

A collection of useful TailwindCSS Plugins

Downloads

34

Readme

@josephmark/hooks

Run Tests

A collection of useful Tailwind plugins from the team at Josephmark

Installation

npm i -S @josephmark/tailwind-plugins

Available Plugins

oklab

Oklab is a perceptual colourspace that is particularly good for gradients as it has a more uniform perceived lightness and hue compared to other colourspaces.

Using Oklab interpolation can make your CSS gradients a bit sweeter and more natural, however it's not supported in Firefox yet.

Configuration

First, add oklab to your tailwind.config.js file:

// tailwind.config.js
const { oklab } = require("@josephmark/tailwind-plugins")
module.exports = {
  plugins: [oklab],
}

Variants

supports-oklab

Check for CSS support of Oklab colours

supports-oklab-grad

Check for CSS support of Oklab gradient interpolation

Utilities

Note - all Oklab colour utilities currently allow JIT values only since your theme is probably in hex or RGB.

bg-gradient-oklab-to-[direction]

Use Oklab interpolation for gradients

eg: bg-gradient-oklab-to-r from-red-500 to-blue-500 or supports-oklab-grad:bg-gradient-oklab-to-r from-red-500 to-blue-500

Note: colours don't need to be Oklab to use interpolation

from-oklab-[colour]

Set gradient start to an Oklab colour

eg: from-oklab-[0.77_-0.09_-0.06] or supports-oklab:from-oklab-[0.77_-0.09_-0.06]

via-oklab-[colour]

Set gradient mid-point to an Oklab colour

eg: via-oklab-[0.78_0.06_0.16]

to-oklab-[colour]

Set gradient end to an Oklab colour

eg: to-oklab-[0.62_0.15_-0.16]

text-oklab-[colour]

Set text to an Oklab colour

eg: text-oklab-[0.77_-0.09_-0.06]

bg-oklab-[colour]

Set background to an Oklab colour

eg: bg-oklab-[0.77_-0.09_-0.06]

containment

CSS containment can help with rendering optimisation, especially on long pages with lots of elements. Setting contain-content content-visibility-auto on an element will let the browser skip rendering it when it is offscreen, saving on render time.

Configuration

First, add containment to your tailwind.config.js file:

// tailwind.config.js
const { containment } = require("@josephmark/tailwind-plugins")
module.exports = {
  plugins: [containment],
}

Utilities

contain-[value]

Set the element's containment mode. Default values are available, and JIT values can be added for specific needs / combination values.

eg: contain-content or contain-[paint_layout]

content-visibility-[value]

Set the element's content visibility property.

eg: content-visibility-auto or content-visibility-hidden

contain-intrinsic-size

Set the element's contain-intrinsic-size property. This allows culled elements to contribute to the page's scroll height to minimise scrollbar jank.

eg: contain-intrinsic-size-auto or contain-intrinsic-size-[auto_500px]