getStyle API not firing?
I'm using the API in one of my content scripts:
export const getStyle: PlasmoGetStyle = () => {
console.log('RUNNING);
const style = document.createElement("style")
style.textContent = styleText
return style
}
But it won't log anything to the conosle, and of course the styles aren't appearing. What could be wrong here? (the content script file does run for sure)
5 Replies
Is this a
ts
file?No, tsx
@Sir-Haveri has reached level 1. GG!
Is it a sub-component? see: https://github.com/PlasmoHQ/plasmo/issues/652
GitHub
[RFC] Load stylesheets in sub-components · Issue #652 · PlasmoHQ/pl...
What happened? The CSS API does not load custom stylesheets when we have a custom one per component. It works only in content.tsx export const getStyle: PlasmoGetStyle = () => { const style = do...
No, I have the function in my single content script content.tsx
The workaround was to manually invoke the function and then it works
Thanks a lot for your help anyhow