Git Product home page Git Product logo

bootstrap-3-grid-columns-clearing's People

Contributors

sixfootsixdesigns avatar slaver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bootstrap-3-grid-columns-clearing's Issues

This is best and needted for me !

Thanks for this solution , i has search in google for some day with this solution , also it work in cross browser ? i need using this for my project !! many thanks !! Regards

Avoid SASS from being compiled

Currently, SASS will try to compile and generate Undefined variable: $screen-sm-min. See screenshot below:

image

What you want to do is rename your multi-columns-row.scss file to begin with an underscore to prevent it from being compiled on its own:

  • multi-columns-row.scss > multi-columns-row.css (compiled... generates the above error)
  • _multi-columns-row.scss > (not compiled)

Lemme know what you think :)

Solving a limitation about classnames

Hi there,

Thanks for your nice solution.

Problem: I realized that there is a limitation in your solution, which is you have to put all classes in order to make it work like this:
<div class="col-xs-6 col-sm-4 col-md-4 col-lg-4">...</div>
but it seems that col-md-4 and col-lg-4 in the above code can be removed.

My solution is this:

/* Bootstrap multi-same-columns
 **************************************************/

/* clear first in row in ie 8 or lower */
.multi-columns-row .first-in-row {
    clear: left;
}

/* clear the first in row for any block that has the class "multi-columns-row" */
.multi-columns-row .col-xs-6:nth-child(2n + 3) { clear: left; }
.multi-columns-row .col-xs-4:nth-child(3n + 4) { clear: left; }
.multi-columns-row .col-xs-3:nth-child(4n + 5) { clear: left; }
.multi-columns-row .col-xs-2:nth-child(6n + 7) { clear: left; }
.multi-columns-row .col-xs-1:nth-child(12n + 13) { clear: left; }

@media (min-width: 768px) {
    /* reset if we have sm class */
    .multi-columns-row [class*="col-"][class*="col-sm-"]{ clear: none; }


    /* clear first in row for small columns */
    .multi-columns-row .col-sm-6:nth-child(2n + 3) { clear: left; }
    .multi-columns-row .col-sm-4:nth-child(3n + 4) { clear: left; }
    .multi-columns-row .col-sm-3:nth-child(4n + 5) { clear: left; }
    .multi-columns-row .col-sm-2:nth-child(6n + 7) { clear: left; }
    .multi-columns-row .col-sm-1:nth-child(12n + 13) { clear: left; }
}
@media (min-width: 992px) {
    /* reset if we have md class */
    .multi-columns-row [class*="col-"][class*="col-md-"]{ clear: none; }

    /* clear first in row for medium columns */
    .multi-columns-row .col-md-6:nth-child(2n + 3) { clear: left; }
    .multi-columns-row .col-md-4:nth-child(3n + 4) { clear: left; }
    .multi-columns-row .col-md-3:nth-child(4n + 5) { clear: left; }
    .multi-columns-row .col-md-2:nth-child(6n + 7) { clear: left; }
    .multi-columns-row .col-md-1:nth-child(12n + 13) { clear: left; }
}
@media (min-width: 1200px) {
    /* reset if we have lg class */
    .multi-columns-row [class*="col-"][class*="col-lg-"]{ clear: none; }

    /* clear first in row for large columns */
    .multi-columns-row .col-lg-6:nth-child(2n + 3) { clear: left; }
    .multi-columns-row .col-lg-4:nth-child(3n + 4) { clear: left; }
    .multi-columns-row .col-lg-3:nth-child(4n + 5) { clear: left; }
    .multi-columns-row .col-lg-2:nth-child(6n + 7) { clear: left; }
    .multi-columns-row .col-lg-1:nth-child(12n + 13) { clear: left; }
}

Now you can use this code:
<div class="col-xs-6 col-sm-4">...</div>
instead of:
<div class="col-xs-6 col-sm-4 col-md-4 col-lg-4">...</div>

or
<div class="col-xs-6 col-md-4">...</div>
instead of
<div class="col-xs-6 col-sm-6 col-md-4 col-lg-4">...</div>

Hope that helps.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.