Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
tailwindcss-plugin-icons
Advanced tools
Tailwind CSS implementation of @unocss/preset-icons.
npm install tailwindcss-plugin-icons
pnpm add tailwindcss-plugin-icons
yarn add tailwindcss-plugin-icons
Search the available icon sets at Icônes or Iconify and choose the icons your project needs.
Install any required icon set with npm install @iconify-json/[the-icon-set-name]
.
Configure the plugin in your tailwind.config
file, for example, heroicons:
import type { Config } from 'tailwindcss'
import { Icons, type Options } from 'tailwindcss-plugin-icons'
const options: Options = ({ theme }) => ({
heroicons: {
icons: {
'plus-circle': {
cursor: 'pointer',
color: theme('colors.emerald.600'),
'&:hover': {
color: theme('colors.emerald.800'),
},
},
'trash?bg': {},
},
includeAll: true,
scale: iconName => (iconName.endsWith('-20-solid') ? 1.25 : 1.5),
location: 'https://esm.sh/@iconify-json/heroicons@1.1.9/icons.json',
},
})
export default {
plugins: [Icons(options)],
} as Config
The plugin's options
are 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. Finally, you can use includeAll: true
to have every icon in the icon set added as a Tailwind source.
Write icons with Tailwind CSS classes directly in your markup:
<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 140 weekly downloads. As such, tailwindcss-plugin-icons popularity was classified as not popular.
We found that tailwindcss-plugin-icons demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.