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-animate-from-to

v0.0.1

Published

A Tailwind CSS plugin for creating custom animations using `from` and `to` keyframes.

Downloads

9

Readme

tailwindcss-animate-from-to

License NPM Version

A Tailwind CSS plugin for creating custom animations using from and to keyframes.

Installation

Install the plugin from npm:

npm install -D tailwindcss-animate-from-to

Then, add the plugin to your tailwind.config.js file:

/** @type {import('tailwindcss').Config} */
module.exports = {
  theme: {
    // ...
  },
  plugins: [
    require("tailwindcss-animate-from-to"),
    // ...
  ],
};

Usage

Opacity

The plugin defines a from and to keyframe for the opacity property, equivalent to:

@keyframes opacity {
  from {
    opacity: var(--tw-opacity-from);
  }
  to {
    opacity: var(--tw-opacity-to);
  }
}

Utilities

  • .animate-opacity: Enable the opacity animation.
  • .opacity-from-{value}: Sets the starting opacity (taken from theme(opacity) or arbitrary value).
  • .opacity-to-{value}: Sets the ending opacity.

Example

<div class="animate-opacity opacity-from-0 opacity-to-100">Hello, world!</div>

Shadow

The plugin defines a from and to keyframe for the box-shadow property, equivalent to:

@keyframes shadow {
  from {
    box-shadow: var(--tw-shadow-from);
  }
  to {
    box-shadow: var(--tw-shadow-to);
  }
}

Utilities

  • .animate-shadow: Enable the box-shadow animation.
  • .shadow-from-{value}: Sets the starting shadow (taken from theme(boxShadow) or arbitrary value).
  • .shadow-to-{value}: Sets the ending shadow.

Example

<div class="animate-shadow shadow-from-md shadow-to-lg">Hello, world!</div>

Transform

The plugin defines a from and to keyframe for the transform property with transform functions: scale, rotate, translate, and skew, equivalent to:

@keyframes transform {
  from {
    transform: "translateX(var(--tw-translate-x-from, 0)) translateY(var(--tw-translate-y-from, 0)) rotate(var(--tw-rotate-from, 0)) skewX(var(--tw-skew-x-from, 0)) skewY(var(--tw-skew-y-from, 0)) scaleX(var(--tw-scale-x-from, 1)) scaleY(var(--tw-scale-y-from, 1))";
  }
  to {
    transform: "translateX(var(--tw-translate-x-to, 0)) translateY(var(--tw-translate-y-to, 0)) rotate(var(--tw-rotate-to, 0)) skewX(var(--tw-skew-x-to, 0)) skewY(var(--tw-skew-y-to, 0)) scaleX(var(--tw-scale-x-to, 1)) scaleY(var(--tw-scale-y-to, 1))";
  }
}

Utilities

  • .animate-transform: Enable the transform animation. All variables are set to 0 (or 1 for scale).
  • .translate-x-from-{value}: Sets the starting translateX (taken from theme(translate) or arbitrary value).
  • .translate-x-to-{value}: Sets the ending translateX.
  • .translate-y-from-{value}: Sets the starting translateY.
  • .translate-y-to-{value}: Sets the ending translateY.
  • .rotate-from-{value}: Sets the starting rotate (taken from theme(rotate) or arbitrary value).
  • .rotate-to-{value}: Sets the ending rotate.
  • .skew-x-from-{value}: Sets the starting skewX (taken from theme(skew) or arbitrary value).
  • .skew-x-to-{value}: Sets the ending skewX.
  • .skew-y-from-{value}: Sets the starting skewY.
  • .skew-y-to-{value}: Sets the ending skewY.
  • .scale-x-from-{value}: Sets the starting scaleX (taken from theme(scale) or arbitrary value).
  • .scale-x-to-{value}: Sets the ending scaleX.
  • .scale-y-from-{value}: Sets the starting scaleY.
  • .scale-y-to-{value}: Sets the ending scaleY.

Example

<div
  class="animate-transform translate-x-from-0 translate-x-to-10 rotate-from-0 rotate-to-360"
>
  Hello, world!
</div>

License

This project is licensed under the MIT license.