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
Teja Bhagavan Kollepara
  • 3,816
  • 5
  • 32
  • 69
  • waiting for suggestions from all of you – Sanjay Satapathy May 09 '18 at 08: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 09 '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 03:38

2 Answers2

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;
Hitesh Koshti
  • 1,445
  • 4
  • 18
  • 36
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
Tazaf
  • 150
  • 6
sami23
  • 568
  • 1
  • 3
  • 10