
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
tailwindcss-plugin-icons
Advanced tools
Tailwind CSS port of @unocss/preset-icons.
# Npm
npm install tailwindcss-plugin-icons
# Pnpm
pnpm add tailwindcss-plugin-icons
# Yarn
yarn add tailwindcss-plugin-icons
npm install @iconify-json/[the-collection-you-want]
.tailwind.config
file, for example, heroicons:const { Icons } = require('tailwindcss-plugin-icons')
/**
* @type {import('tailwindcss-plugin-icons').Options}
*/
const options = ({ theme }) => ({
heroicons: {
icons: {
'plus-circle': {
cursor: 'pointer',
color: theme('colors.emerald.600'),
'&:hover': {
color: theme('colors.emerald.800')
}
},
'trash?bg': {}
},
scale: 1.5,
includeAll: true,
location: 'https://esm.sh/@iconify-json/heroicons@1.1.6/icons.json'
}
})
/**
* @type {import('tailwindcss').Config}
*/
module.exports = {
plugins: [Icons(options)]
}
The plugin's options
is a function. It gets forwarded the Tailwind CSS plugin API and returns the selected icons with optional default style and scale. After the icon's name, you can pass ?bg
or ?mask
to force a specific render method (see also the comprehensive example).
<div class="i-heroicons-plus-circle"></div>
<div class="bg-heroicons-trash-black"></div>
FAQs
Tailwind CSS icons with classes
The npm package tailwindcss-plugin-icons receives a total of 98 weekly downloads. As such, tailwindcss-plugin-icons popularity was classified as not popular.
We found that tailwindcss-plugin-icons demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.