Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tailwindcss-counter

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tailwindcss-counter

Tailwind CSS plugin to generate counter utilities

  • 1.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
84
decreased by-50.88%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 13 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc