Skip to content

Commit

Permalink
feat: add ability to specify icon colors with tailwind
Browse files Browse the repository at this point in the history
  • Loading branch information
tigranpetrossian committed Aug 14, 2024
1 parent 6cb8ede commit c20950f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions figma-kit/src/tailwind/preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,4 +284,23 @@ export default {
};
},
},
plugins: [
function ({ addUtilities, theme }) {
const iconColors = {
current: 'currentColor',
inherit: 'inherit',
transparent: 'transparent',
...theme('colors').icon,
};

const newUtilities = Object.keys(iconColors).reduce((acc, colorName) => {
acc[`.icon-${colorName}`] = {
'--color-icon': iconColors[colorName],
};
return acc;
}, {});

addUtilities(newUtilities, ['responsive', 'hover']);
},
],
};

0 comments on commit c20950f

Please sign in to comment.