2017-10-07 13:47:51 -04:00
|
|
|
import _ from 'lodash'
|
|
|
|
|
import functions from 'postcss-functions'
|
|
|
|
|
|
2019-01-21 13:52:07 -05:00
|
|
|
export default function(config, pluginConfigValues) {
|
2017-10-07 13:47:51 -04:00
|
|
|
return functions({
|
|
|
|
|
functions: {
|
2017-11-04 01:32:25 -05:00
|
|
|
config: (path, defaultValue) => {
|
2019-01-21 13:52:07 -05:00
|
|
|
const trimmedPath = _.trim(path, `'"`)
|
|
|
|
|
return _.get(config, trimmedPath, _.get(pluginConfigValues, trimmedPath, defaultValue))
|
2017-11-05 13:32:02 -06:00
|
|
|
},
|
|
|
|
|
},
|
2017-10-07 13:47:51 -04:00
|
|
|
})
|
|
|
|
|
}
|