I want to create seperate stylesheets for each block, however I never got it working so I always did bad workarounds..
I tried using this:
‘enqueue_style’ => get_template_directory_uri() . ‘/template-parts/blocks/testimonial/testimonial.css’,
I can however see in the source code that it’s trying to look for the css file in my parent theme. I trhen replaced “get_template_directory_uri()” with “get_theme_file_uri()” and I can now see that the stylesheet is being loaded like this:
I can even press the link and it brings me to the right file, however the styles aren’t being applied. I tried doing this both on my personal sites which are developed locally, and on the enviroment of the agency I work at, which is done on live sites, with different themes – however I never got it working properly.. any idea on what I’m doing wrong?