I want to include a new css file styles.css. Steps I've taken:
1) switch to developer mode (magento deploy:mode:set developer);
2) edit dev/tools/grunt/configs/themes.js and include my theme with my new file styles:
my_theme: {
area: 'frontend',
name: 'My_company/my_theme',
locale: 'en_GB',
files: [
'css/styles',
],
dsl: 'less'
},
3) In My_company/my_theme/Magento_Theme/layout/default_head_blocks.xml
I add it like this <css src="css/styles.css" />
4) In My_company/my_theme/web/css/syles.less I add @import 'source/_theme.less'; and then have My_company/my_theme/web/css/_theme.less with different variables.
5) Run grunt clean, grunt exec, grunt less and it went along fine without errors:
Running "less:my_theme" (less) task
File pub/static/frontend/My_company/my_theme/en_GB/css/styles.css created: 435 B → 992 B
Tried removing everything from the var folder and from pub/static except the .htaccess. Cleared cache, regenerating static folder magento setup:static-content:deploy. Checked in the admin that my theme is selected in web > design. Reindexed.
In view page source magento is still looking for pub/static/frontend/My_company/my_theme/en_GB/css/styles-m.css (which returns a 404) and not including pub/static/frontend/My_company/my_theme/en_GB/css/styles.css
Where can I look next?
Thanks!