fooman / venia-ui-override-resolver

19 stars 5 forks source link

Easily extend CSS instead of overwriting it #5

Open AdamC3Media opened 2 years ago

AdamC3Media commented 2 years ago

Hi,

I'm fairly new to PWA, but I've been using your module and it's great. I was wondering if it's possible to extend the CSS instead of overwriting it. I've found a blog post that shows how to extend the CSS - https://dev.to/chrisbrabender/simplifying-targetables-in-pwa-studio-p8b. Unfortunately it doesn't work alongside your module.

Do you know if there's a way to use your module and extend the CSS?

Kind regards.

Adam

fooman commented 2 years ago

@AdamC3Media extending CSS should be possible from the parent component's JS as most Venia UI component merge classes like this https://github.com/magento/pwa-studio/blob/develop/packages/venia-ui/lib/components/Footer/footer.js#L17

This is a default PWA Studio feature.

I haven't checked with Chris's technique but am currently not seeing anything that should prevent both techniques to work alongside each other. There is also this https://github.com/larsroettig/component-targetables based on Chris's post.