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

@endorian/tailwindcss-plugin-twicpics

v0.1.0

Published

A Tailwind CSS plugin to use TwicPics's [Style-Driven Approach](https://www.twicpics.com/docs/components/next#style-driven-approach).

Downloads

4

Readme

tailwindcss-plugin-twicpics

A Tailwind CSS plugin to use TwicPics's Style-Driven Approach.

npm install --save-dev @endorian/tailwindcss-plugin-css-twicpics

Note: This plugin requires Tailwind CSS as peer dependency.

⚙️ Configuration

Add the plugin to your tailwind.config.js file:

Using CommonJS

// tailwind.config.js
module.exports = {
  // ...
  plugins: [require('@endorian/tailwindcss-plugin-twicpics')]
}

Using ES Modules

// tailwind.config.js
import tailwindcssPluginTwicPics from '@endorian/tailwindcss-plugin-twicpics'

module.exports = {
  // ...
  plugins: [tailwindcssPluginTwicPics]
}

🛠️ Usage

This plugin adds multiple utility classes to your Tailwind CSS configuration to use TwicPics's Style-Driven Approach. These utility classes will add CSS variables to the element containing the class.

Mode

.twic-mode-{mode}

This utility allows you to set the mode.

Possible modes from TwicPics' documentation are:

  • cover
  • contain
<!-- Example -->
<div class="twic-mode-contain">
  ...
</div>

Position

.twic-position-{position}

This utility allows you to set the position.

Possible positions from TwicPics' documentation are:

  • top
  • right
  • bottom
  • left
  • center
  • top-left
  • top-right
  • bottom-left
  • bottom-right
<!-- Example -->
<div class="twic-position-top-right">
  ...
</div>

Ratio

.twic-ratio-{ratio}

This utility allows you to set the ratio.

Predefined values are:

  • square (1)
  • video (16/9)
  • landscape (4/3)
  • portrait (2/3)
<!-- Example -->
<div class="twic-ratio-square">
  ...
</div>

You can add your ratios by extending your Tailwind CSS configuration like in the following example:

// tailwind.config.js
module.exports = {
  theme: {
    // ...
    extend: {
      // ...
      twicRatio: {
        'myratio': '1/2'
      }
    }
  }
}

Transition delay

.twic-delay-{delay}

This utility allows you to set the delay. Per default, you can use Tailwind's transition delays.

<!-- Example -->
<div class="twic-delay-150">
  ...
</div>

You can add your TwicPics-related delays by extending your Tailwind CSS configuration like in the following example:

// tailwind.config.js
module.exports = {
  theme: {
    // ...
    extend: {
      // ...
      twicTransitionDelay: {
        'mydelay': '150ms'
      }
    }
  }
}

Transition duration

.twic-duration-{duration}

This utility allows you to set the transition duration. Per default, you can use Tailwind's transition durations.

<!-- Example -->
<div class="twic-duration-300">
  ...
</div>

When you miss some durations, you can add your TwicPics-related durations by extending your Tailwind CSS configuration like in the following example:

// tailwind.config.js
module.exports = {
  theme: {
    // ...
    extend: {
      // ...
      twicTransitionDuration: {
        'myDuration': '300ms'
      }
    }
  }
}

Transition timing functions

.twic-{easing}

This utility allows you to set the transition timing function. Per default, you can use Tailwind's transition timing functions.

<!-- Example -->
<div class="twic-in-out">
  ...
</div>

You can use your timing functions by extending your Tailwind CSS configuration, like in the following example:

// tailwind.config.js
module.exports = {
  theme: {
    // ...
    extend: {
      // ...
      twicTransitionTimingFunction: {
        'myTimingFunction': 'cubic-bezier(...)'
      }
    }
  }
}

Zoom

.twic-zoom-{zoom}

This utility allows you to set the zoom.

Predefined zooms are:

  • 1
<!-- Example -->
<div class="twic-zoom-1">
  ...
</div>

When you miss some zooms, you can add your TwicPics-related zooms by extending your Tailwind CSS configuration like in the following example:

// tailwind.config.js
module.exports = {
  theme: {
    // ...
    extend: {
      // ...
      twicZoom: {
        'myZoom': '2'
      }
    }
  }
}

📄 License and Contribution

This plugin is licensed under the MIT License. Feel free to contribute by creating a merge request or by opening an issue if you find a bug or want to request a feature.