I am using Toolset Layouts with the Toolset Starter Theme.
I am using some @media queries:-
e.g. to change the menu items when the screen width reduces.
e.g. to change the page width.
These work fine on all pages and single posts but none of the @media queries work when I use a category archive cell in Layouts.
So a page example is hidden link
And a single post example is hidden link
For both of these the @media queries are working correctly.
Now look to hidden link which is a category archive.
Assuming you are looking on a desk-top screen then you will see two differences:-
- The page width is reduced
- The menu reveals an additional item 'MORE' which should be hidden
This is because the @media queries are being ignored.
Could you have a look and let me know if you see a problem please.
Regards
Robert
Hi, this is related to a bug that has been reported by some other users. Our developers are working on a permanent fix that will resolve the issue. It's actually not that the styles are being ignored, it's that they're being overridden. What is happening here is that the CSS file generated by Layouts CSS is loaded in a different order on certain pages. Sometimes Bootstrap CSS is loaded before it, sometimes after it. If Layouts CSS is loaded after Bootstrap CSS, your .container styles will be applied effectively. If it's loaded before, it can be overridden by Bootstrap's CSS that defines the overall container size. You can see the results of this difference in the browser inspector - screenshots attached.
While they are working on a fix, I can make a recommendation for you that may help in the short term: use more specific selectors instead of just .container for your style targets. Bootstrap targets only .container for this width definition, so if you target with multiple class names then your styles will have more priority than Bootstrap's styles regardless of source load order. Example:
@media screen and (min-width: 1200px) {
.archive .container, .post-template .container, .page-template .container {
width: 1230px;
}
}
@media screen and (min-width: 1920px) {
.archive .container, .post-template .container, .page-template .container {
width: 1600px;
}
}
These styles will always override .container, since they are more specific. More info about that:
hidden link
Hi Christian
Thanks for the info and workaround which I have implemented.
I will keep a look to the next update and hopefully the issue will have a permanent fix.
Best regards
Robert
Hi, the new version of Layouts released today includes a permanent fix for this issue. Thanks for your patience while we worked towards the correct solution. Feel free to leave feedback in a new ticket if necessary.