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

tailwindcss-directional-shadows

v0.1.13

Published

Extend TailwindCSS to support directional shadows

Downloads

110

Readme

minified size license version twitter

tailwindcss-directional-shadows is a plugin for Tailwind CSS that introduces directional shadow utilities. This provides more flexibility in casting shadows in specific directions and also allows for the creation of shadows as borders, which can be particularly useful with position: sticky on tables.

Installation

You can install the plugin via npm:

npm install tailwindcss-directional-shadows

Then, include it in your tailwind.config.js:

module.exports = {
  plugins: [
    require('tailwindcss-directional-shadows'),
  ]
}

Usage

The plugin provides several utilities for applying shadows in different directions. Here's an overview:

Directional Shadows

You can apply shadows in specific directions using the shadow-[direction]-[size] utility. The direction can be top (t), right (r), bottom (b), or left (l). The size is optional and can be one of sm, md, lg, xl, 2xl, or left blank for the default size.

<div class="shadow-t">...</div>
<div class="shadow-r-sm">...</div>
<div class="shadow-b-md">...</div>
<div class="shadow-l-xl">...</div>

Shadows as Borders

Shadows can also be used as borders, which can be especially useful with position: sticky on tables. The plugin provides several utilities for this purpose:

  • shadow-border-[size] applies the shadow border on all sides.
  • shadow-border-x-[size] applies the shadow border on the left and right.
  • shadow-border-y-[size] applies the shadow border on the top and bottom.
  • shadow-border-t-[size], shadow-border-b-[size], shadow-border-l-[size], and shadow-border-r-[size] apply the shadow border on the top, bottom, left, and right, respectively.
<div class="shadow-border-2">...</div>
<div class="shadow-border-x-4">...</div>
<div class="shadow-border-y-2">...</div>
<div class="shadow-border-t-4">...</div>

Please replace [size] with an appropriate size from the Tailwind CSS border width scale (e.g., 2, 4, etc.).

Why use tailwindcss-directional-shadows

tailwindcss-directional-shadows allows you to easily apply shadows in different directions and use shadows as borders. This enhances the flexibility of your designs, enabling more precise shadow control and introducing new design possibilities such as shadow-bordered tables with sticky positioning.


I hope you find tailwindcss-directional-shadows a valuable addition to your projects. If you have any issues or suggestions, don't hesitate to open an issue or pull request.

If you liked this, you might also like my other Tailwind CSS plugins: