2017-10-07 13:47:51 -04:00
|
|
|
import _ from 'lodash'
|
|
|
|
|
import functions from 'postcss-functions'
|
|
|
|
|
|
2019-01-22 11:47:48 -05:00
|
|
|
export default function(config) {
|
2017-10-07 13:47:51 -04:00
|
|
|
return functions({
|
|
|
|
|
functions: {
|
2019-03-12 21:20:31 -04:00
|
|
|
theme: (path, ...defaultValue) => {
|
2019-04-16 11:43:17 -04:00
|
|
|
return _.thru(_.get(config.theme, _.trim(path, `'"`), defaultValue), value => {
|
2019-07-13 16:52:07 +02:00
|
|
|
return Array.isArray(value) ? value.join(', ') : value
|
2019-04-16 11:43:17 -04:00
|
|
|
})
|
2017-11-05 13:32:02 -06:00
|
|
|
},
|
|
|
|
|
},
|
2017-10-07 13:47:51 -04:00
|
|
|
})
|
|
|
|
|
}
|