Closed patrulea closed 1 year ago
Try move background
to a simple value issues of function
You mean something like this?
module.exports = {
background: data => shop.brand.colors.primary[0].background,
// …
}
background: shop.brand.colors.primary[0].background
Thanks! That solved the syntax issue. I’m still troubleshooting since shopify.js
exports an async function, and PostCSS seems to get undefined keys from it. But that’s a different topic.
I have a JavaScript file fetching data from a Shopify store through their Storefront API and I want to make the brand colors available as variables in PostCSS. Though,
$background
and$foreground
return the function as a string when their variables are referenced.The other variables (
$rem
,$border
,$duration
) work as intended.I’m new to JavaScript so I sort of don’t knot what I’m doing.