1

I am new to magento2 development and have tried every possible senario's but still unable to reproduce the issue why my _theme.less file is not overriding existing styles.I have put my less file inside source folder.

Please find below senario's.

In my parent theme

.header . content have max-width:1280px

In my theme.less file

.header .content have max-width:1100px
  • waiting for suggestions from all of you – Sanjay Satapathy May 9 '18 at 8:18
  • I am a new Magento 2 developer as well. and I find it the steepest learning curve of any CMS. Why do they have to have such a horrible DX. Just make it like wordpress already. And yes I am still stuck on this exact same thing. – Dustin Poissant May 9 '18 at 14:53
  • Can anyone have video tutorial uploaded for same css overriding?.it will be a great help for developers like us who are stuck with this thing to overcome. – Sanjay Satapathy May 10 '18 at 3:38
1

You can override below file :

/lib/web/css/source/lib/variables/_layout.less

In your theme :

/app/design/frontend/Vendor/YourTheme/web/css/source/lib/variables/_layout.less

Changed in line No. 12

@layout__max-width: 1280px;

TO

@layout__max-width: 1100px;
| improve this answer | |
0

Put an empty file in theme_dir/web/css/source/_theme.less. The blank file will override the _theme.less file. After that run :

php bin/magento cache:clean
php bin/magento cache:flush 
php bin/magento setup:static-content:deploy
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.