pixelastic / norska

🏔️ Custom SSG using Pug, Webpack, PostCSS and Tailwind.
https://projects.pixelastic.com/norska/
MIT License
8 stars 0 forks source link

Update .fill-current to also apply to path #148

Open pixelastic opened 3 years ago

pixelastic commented 3 years ago

The current .fill-current only changes the main color of an svg, and do not apply to path elements. I'm defining a custom color in my SVGs so they can be used as colored favicons

This is the code I'm using actually, but it should be part of the main Tailwind config.

/**
 * By default, we use the same svg file for the favicon and for the header. But
 * we might want to color them differently.
 * To color the favicon, we can set a custom `fill` attribute inside it, but to
 * be able to overwrite the color of in the website, we need to force
 * overwriting the path color
 **/
.fill-current path {
  @apply fill-current;
}