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

tailwindcss-primeui

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tailwindcss-primeui

Utilities for Tailwind CSS

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
51K
increased by1.28%
Maintainers
1
Weekly downloads
 
Created
Source

Tailwind CSS Utilities for Prime UI Libraries

Extended utilities to integrate Prime UI library theming with Tailwind CSS and add the missing animation utilities from the legacy PrimeFlex.

Prime UI Library

This plugin requires a Prime UI library with the next-gen theming, compatible with styled and unstyled modes.

  • primevue v4+
  • primeng v18+
  • @primereact/core v1+

Installation

Install the plugin from npm.

npm i tailwindcss-primeui

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

// tailwind.config.js
module.exports = {
    // ...
    plugins: [require('tailwindcss-primeui')]
};

Colors

Prime UI libraries utilize a color palette that consists of primary colors and surfaces, these colors can be used as Tailwind extensions.

<div class="bg-primary text-primary-contrast border-primary-500">Content</div>
<div class="bg-surface-50 dark:bg-surface-900 text-surface-900 dark:text-surface-0 border-surface-200 dark:border-surface-700">Content</div>
ColorDescription
primary-[50-950]Primary colors
surface-[0-950]Surface colors
primaryDefault primary color
primary-contrastDefault primary contrast color
primary-emphasisDefault primary emphasis color
highlightDefault highlight color
highlight-emphasisDefault highlight emphasis color
highlight-contrastDefault highlight contrast color
highlight-emphasis-contrastDefault highlight emphasis contrast color

Animations

PrimeFlex provide various animation utilities that are missing in Tailwind CSS core, this plugin adds these plugins for migration.

Duration

ClassProperties
animate-duration-0animation-duration: 0s;
animate-duration-75animation-duration: 75ms;
animate-duration-100animation-duration: 100ms;
animate-duration-150animation-duration: 150ms;
animate-duration-200animation-duration: 200ms;
animate-duration-300animation-duration: 300ms;
animate-duration-400animation-duration: 400ms;
animate-duration-500animation-duration: 500ms;
animate-duration-700animation-duration: 700ms;
animate-duration-1000animation-duration: 1000ms;
animate-duration-2000animation-duration: 2000ms;
animate-duration-3000animation-duration: 3000ms;

Delay

ClassProperties
animate-delay-noneanimation-delay: 0ms;
animate-delay-75animation-delay: 75ms;
animate-delay-100animation-delay: 100ms;
animate-delay-150animation-delay: 150ms;
animate-delay-200animation-delay: 200ms;
animate-delay-300animation-delay: 300ms;
animate-delay-400animation-delay: 400ms;
animate-delay-500animation-delay: 500ms;
animate-delay-700animation-delay: 700ms;
animate-delay-1000animation-delay: 1000ms;

Iteration Count

ClassProperties
animate-infiniteanimation-iteration-count: infinite;
animate-onceanimation-iteration-count: 1;
animate-twiceanimation-iteration-count: 2;

Direction

ClassProperties
animate-normalanimation-direction: normal;
animate-reverseanimation-direction: reverse;
animate-alternateanimation-direction: alternate;
animate-alternate-reverseanimation-direction: alternate-reverse;

Timing Function

ClassProperties
animate-ease-linearanimation-timing-function: linear;
animate-ease-inanimation-timing-function: cubic-bezier(0.4, 0, 1, 1);
animate-ease-outanimation-timing-function: cubic-bezier(0, 0, 0.2, 1);
animate-ease-in-outanimation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);

Fill Mode

ClassProperties
animate-fill-noneanimation-fill-mode: normal;
animate-fill-forwardsanimation-fill-mode: forwards;
animate-fill-backwardsanimation-fill-mode: backwards;
animate-fill-bothanimation-fill-mode: both;

Play State

ClassProperties
animate-runninganimation-play-state: running;
animate-pausedanimation-play-state: paused;

Backface Visibility

ClassProperties
backface-visiblebackface-visibility: visible;
backface-hiddenbackface-visibility: hidden;

Animations

ClassProperties
animate-fadeinfadein 0.15s linear
animate-fadeoutfadeout 0.15s linear
animate-slidedownslidedown 0.15s linear
animate-slideupslideup 0.15s linear
animate-scaleinscalein 0.15s linear
animate-fadeinleftfadeinleft 0.15s linear
animate-fadeoutleftfadeoutleft 0.15s linear
animate-fadeinrightfadeinright 0.15s linear
animate-fadeoutrightfadeoutright 0.15s linear
animate-fadeinupfadeinup 0.15s linear
animate-fadeoutupfadeoutup 0.15s linear
animate-fadeindownfadeindown 0.15s linear
animate-fadeoutupfadeoutup 0.15s linear
animate-widthwidth 0.15s linear
animate-flipflip 0.15s linear
animate-flipupflipup 0.15s linear
animate-flipleftflipleft 0.15s linear
animate-fliprightflipright 0.15s linear
animate-zoominzoomin 0.15s linear
animate-zoomindownzoomindown 0.15s linear
animate-zoominleftzoominleft 0.15s linear
animate-zoominrightzoominright 0.15s linear
animate-zoominupzoominup 0.15s linear

Variant modifiers and breakpoints

All variants and breakpoints are supported.

<div class="lg:hover:bg-primary lg:hover:animate-fadein motion-reduce:animate-none">
    <!-- ... -->
</div>

Arbitrary values

Any value within the square brackets allow defining one-off values that do not need to be defined as a reusable utility.

<div class="animate-delay-[450ms] animate-duration-[4s]">
    <!-- ... -->
</div>

Customizing the Plugin

The default values can be customized using as a theme extension.

// tailwind.config.js
module.exports = {
    theme: {
        extend: {
            animationDelay: {
                475: '475ms',
                2000: '2s'
            },
            animationDuration: {
                4000: '4s',
                slow: '10s'
            }
        }
    },
    plugins: [require('tailwindcss-primeui')]
};

Keywords

FAQs

Package last updated on 23 May 2024

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