This tiny JavaScript (no jQuery etc. required) looks for every data attribute data-max-width
and records its value (that you set, in pixels). Example:
<div data-max-width="1000" class="my-container">
...
</div>
/* | |
Really Simple Grid Sysrem | |
*/ | |
.grid img { | |
max-width: 100%; | |
height: auto; | |
} | |
.grid { | |
width: 100%; |
.hero-background-image[style] { | |
height: 340px !important; | |
background-color: #888 !important; | |
background-size: auto 340px !important; | |
@media (min-width: 768px) { | |
height: 440px !important; | |
background-size: auto 440px !important; | |
} | |
@media (min-width: 1024px) { | |
height: 500px !important; |
<?php $hero = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' ); ?> | |
<div class="hero-background-image" style="background: url('<?php echo $hero['0'];?>') center top no-repeat;"> | |
<!-- Put your loop <header> in here. --> | |
</div> |
#your-thing-id.your-toggle-class { | |
/* | |
Any styling you like can go in here, for example... | |
*/ | |
background: yellow; | |
} |
.container-responsive { | |
width: 100%; | |
max-width: 1140px; | |
padding-right: 15px; | |
padding-left: 15px; | |
margin-right: auto; | |
margin-left: auto; | |
} | |
.navbar > .container-responsive { |
/** | |
* Iterating from Andy Bell's full-bleed CSS utility (https://hankchizljaw.com/wrote/creating-a-full-bleed-css-utility/) | |
* simply set a max-width for those blocks you want to be wider than your centered prose column. | |
* Useful if you have an image (or background image) that doesn't look good on massively wide viewports. | |
*/ | |
.partial-bleed { | |
width: 100vh; | |
max-width: 1200px; /* example assumes your main prose max-width is e.g. 800px */ | |
margin-left: 50%; |