Big news!Introducing Socket AI - ChatGPT-Powered Threat Analysis. Learn more
Socket
Log inDemoInstall

tailwindcss-counter

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Issues
File Explorer

Advanced tools

tailwindcss-counter

Tailwind CSS plugin to generate counter utilities

    1.1.3latest
    GitHub

Version published
Maintainers
1
Weekly downloads
324
decreased by-29.1%

Weekly downloads

Readme

Source

tailwindcss-counter

Tailwind CSS plugin to generate counter utilities

Installation

npm i tailwindcss-counter

Usage

// tailwind.config.js module.exports = { theme: {}, variants: {}, plugins: [ require('tailwindcss-counter')(), // Or if you want to set your own counter name: // require('tailwindcss-counter')({ // counterName: 'yourUniqueCounterName' // }), ], };

This plugin generates the following utilities:

.counter-reset { counter-reset: uniqueCounterName } .counter-increment { counter-increment: uniqueCounterName 1 } .counter-decrement { counter-increment: uniqueCounterName -1 } .counter-result { content: counter(uniqueCounterName) } .after\:counter-result::after { content: counter(uniqueCounterName) } .before\:counter-result::before { content: counter(uniqueCounterName) }

which you can use in your HTML like so:

<div class="counter-reset"> <div class="after:counter-result">Initial: </div> <div class="counter-increment after:counter-result">Incremented: </div> <div class="counter-increment after:counter-result">Incremented: </div> <div class="counter-increment after:counter-result">Incremented: </div> <div class="counter-decrement after:counter-result">Decremented: </div> <div class="counter-decrement after:counter-result">Decremented: </div> <div class="counter-decrement after:counter-result">Decremented: </div> <div class="before:counter-result"> is a result</div> </div>

Demo

Take a look

Screenshot of the demo

Keywords

FAQs

Last updated on 13 Dec 2020

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket
support@socket.devSocket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc