Add stroke-width plugin
This commit is contained in:
parent
05dc027536
commit
ba640fc79a
6 changed files with 286 additions and 0 deletions
19
src/plugins/strokeWidth.js
Normal file
19
src/plugins/strokeWidth.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import _ from 'lodash'
|
||||
import flattenColorPalette from '../util/flattenColorPalette'
|
||||
|
||||
export default function() {
|
||||
return function({ addUtilities, e, theme, variants }) {
|
||||
const utilities = _.fromPairs(
|
||||
_.map(flattenColorPalette(theme('strokeWidth')), (value, modifier) => {
|
||||
return [
|
||||
`.${e(`stroke-w-${modifier}`)}`,
|
||||
{
|
||||
'stroke-width': value,
|
||||
},
|
||||
]
|
||||
})
|
||||
)
|
||||
|
||||
addUtilities(utilities, variants('strokeWidth'))
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue