Styles Placeholder not working

Hi, I’m having a strange issue with OC (it was 3.5 and updated to latest with same result). For some reason the {% styles %} placeholder is not working. The css files loaded with components using the method addCss do not work. Making {% put styles %} not working either… really not sure what’s going on. No error, no warning, nothing. just ignoring all that
Even making a customstyles placeholder, it doesn’t work. nothing gets added in the . On the other hand, The scripts placeholder is working great adding the scripts to the footer partial.

Already tried disable plugins (only a couple of my own that I use on every site without this problem) and the problem persists. My layout file is exactly the same as all my other sites without this problem. Could be some bug on latest versions?

DATA: if the component that uses addCss or the {% put styles %} is used directly in a page, it works. But if it’s used in a partial, the styles don’t get added. My partial for example is a clients carousel made with slick. I’d like the css to be used only if the partial is used. But even adding the partial directly to the layout doesn’t work. Adding the partial to my header or footer partials also not working.

Hey @federico.schafer

It’s a load order issue. If the partial is used in a layout and the {% styles %} tag is already called, it won’t appear since the styles have already been rendered… This would be my best guess.

A layout can’t inject itself like that, usually a Page will inject to the Layout. A layout rarely needs to inject to itself.

So for example, if my carousel partial (that uses the put styles tag or the component that calls the styles) is called in my footer partial, that is called in the layout… it wont work?
I guess this it’s not that strange to have to use something like a prefooter for example. I could always in that case call the styles manually… but the point of doing it in a component is for re usability.

I agree that is strange that a layout would inject itself, but through header and footer partials that are usually part of the layout it’s a much more common pattern.