Created
August 28, 2021 04:10
-
-
Save davidroyer/c0e677e19e758dc9e9c16423571bc832 to your computer and use it in GitHub Desktop.
Tailwind Overwrite Select Icon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const plugin = require('tailwindcss/plugin') | |
const svgToDataUri = require('mini-svg-data-uri') | |
module.exports = { | |
purge: [], | |
darkMode: false, // or 'media' or 'class' | |
theme: { | |
extend: {} | |
}, | |
variants: { | |
extend: {} | |
}, | |
plugins: [ | |
require('@tailwindcss/forms'), | |
plugin(function ({ addComponents, theme }) { | |
addComponents({ | |
select: { | |
'background-image': `url("${svgToDataUri( | |
`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20"><path stroke="${theme('colors.blue.500')}" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M6 8l4 4 4-4"/></svg>` | |
)}")` | |
} | |
}) | |
}) | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment