Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having trouble changing the max-width of a theme in Magento 2.

I've found the CSS in:

<THEME>https://waybackassets.bk21.net/css/source/_layout.less

max-width: @layout__max-width;

Then in the Magento Lib folder there is documentation for the variable:

@layout__max-width              
Default: 1280px
Allowed Values: '' | false | value
Comment: Page maximum width

So i tried adding a new definition to my _layout.less file

@layout__max-width:1185px;

Also tried adding the same definition to _theme.less file

But i'm still getting max-width of 1280px

Any ideas what i've done wrong would be greatly appreciated

Thanks

share|improve this question

bumped to the homepage by Community 9 hours ago

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

    
Clear cache and check again. – S H Patel Jul 29 '16 at 10:07
    
Can you please let me know the right way of modifying the less vraible, I have tried @TiEul answer but that is not working – mjdevloper Dec 19 '16 at 6:28

You can write this code in _theme.less

@layout__max-width:1185px;
share|improve this answer
    
Hi, I've already put that code into the _theme.less file and its had no effect – Ben Feb 15 '16 at 20:02

Looks like you put the file in the wrong directory, the correct location is:

app/design/frontend/<Vendor>/<Theme>https://waybackassets.bk21.net/css/source/lib/variables/_layout.less

I just tried your example locally and it worked fine when I put it in the correct place.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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