my-theme
_sass-essentials
components
my-component
my-component.theme
my-theme.theme
YAML Created with Sketch.
my-theme.info.yml
YAML Created with Sketch.
my-theme.libraries.yml

We haven’t mentioned the possibility of having component specific .theme files anywhere else in the documentation. The reason is because it's not vital to your project. If you want to get in to PHP as a themer, this is the way to do it. Usually 95% of what you want to accomplish inside the theming layer is possible within Twig templates. But for that extra 5%, we have the possibility of having a component-specific my-component.theme file.

You can see this file as a partial of the my-component.theme file. There is no added functionality you can write in here that you can’t write in the my-theme.theme file.

Naming convention #

Any component can contain a my-component.theme file. The naming convention is to use the same name like the name of the component’s folder. 

Please note: Gulp will try to rebuild the cache after you add a my-component.theme file.