Code Monkey home page Code Monkey logo

Comments (3)

bryanwillis avatar bryanwillis commented on May 18, 2024

@TheKidCoder Seems like there's a few issues with .equalHeight.

Have you noticed yet that while .equalHeight causes the block element children of .col-* grow vertically, they end up shrinking horizontally as though they were inline blocks.

http://codepen.io/bootstrapped/pen/bwKoBA?editors=1100

Basically the only way for it to work is the children elements need to be wrapped in a div that has either width:100%; or flex-grow: 1; applied to it otherwise they will shrink horizontally and act as inline-blocks even if they're not.

Temp solutions:

<style>
.block {
  width: 100%;
}
</style>
  <div class="col-6_sm-12">
    <div class="block">

    </div>
  </div>

or

<style>
.block {
  flex-grow: 1;
}
</style>
  <div class="col-6_sm-12">
    <div class="block">

    </div>
  </div>

from gridlex.

bryanwillis avatar bryanwillis commented on May 18, 2024

Actually, .equalHeight seems pointless the more I look at it. Since width: 100%f needs to be added added to the child element of the columns, you could actually just add height: 100% to that element and drop .equalHeight all together.

So from what I can tell this actually does the same thing with needing .equalHeight:

<style>
.h100 {
  height: 100%;
}
</style>
<div class="grid">
  <div class="col-6_sm-12">
    <div class="block">
    ....
    </div>
  <div class="col-6_sm-12">
    <div class="h100">
    ....
    </div>
  </div>

I realized the horizontal shrinking issue could be fixed by adding flex-direcion: column to the .col classes, but that messes other things up, like when using .grid col with nested columns.

Anyway, maybe someone else has a better solutions, but for now the .equalHeight doesn't seem worth it to me.

from gridlex.

devlint avatar devlint commented on May 18, 2024

Hello both of you,
@TheKidCoder I've merged your code.
@bryanwillis I fix your issue by addind children of equalHeight>cols flex: 1 value.

from gridlex.

Related Issues (20)

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.