Skip to content

Instantly share code, notes, and snippets.

@davidroyer
Created August 28, 2021 04:10
Show Gist options
  • Save davidroyer/c0e677e19e758dc9e9c16423571bc832 to your computer and use it in GitHub Desktop.
Save davidroyer/c0e677e19e758dc9e9c16423571bc832 to your computer and use it in GitHub Desktop.
Tailwind Overwrite Select Icon
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