html - How can I change Bootstraps screen width breakpoints programatically? -


on web page have full height 300px sidebar animates in right whenever user needs fill out form.

the problem sidebar messes grid layout of main content area, since it's pushing content instead of being overlay.

programatically can detect when sidebar open. , change bootstrap media query breakpoints whenever it's open.

is possible?

few screenshots: enter image description here

enter image description here

you can achieve flexboxes, bootstrap isn't designed that.

function togglesidebar() {    const cls = 'is-sidebar-open';    const wrapper = document.queryselector('.wrapper');        return wrapper.classlist.contains(cls)       ? wrapper.classlist.remove(cls)      : wrapper.classlist.add(cls)    ;  }    document.addeventlistener('domcontentloaded', () => {    return document      .queryselector('#togglesidebar')      .addeventlistener('click', togglesidebar)    ;  })
.main {    flex: 1 1 100%;    background: gray;  }    .sidebar {    flex: 0 0 0;    background: cyan;    transition: 450ms linear;  }    .wrapper {    display: flex;    min-height: 400px;  }    .wrapper.is-sidebar-open .sidebar {    flex-basis: 100px;  }
<button id="togglesidebar">open sidebar</button>    <div class="wrapper">    <div class="main"></div>    <div class="sidebar"></div>  </div>


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -