Git Product home page Git Product logo

mesh's Introduction

Mesh, a simple grid

Mesh is a simple grid that will fall-back to the old-style grid to avoid your typical internet-explorer issues. It supports most grid functionality and utilizes CSS margin collapsing to make the grid pad items accordingly.

If you want to learn more about grids, check out this documentation that Mozilla wrote on it. It contains the fundamentals for this grid system too.

Mesh, a simple grid

Mesh is a simple grid that will fall-back to the old-style grid to avoid your typical internet-explorer issues. It supports most grid functionality and utilizes CSS margin collapsing to make the grid pad items accordingly.

If you want to learn more about grids, check out this documentation that Mozilla wrote on it. It contains the fundamentals for this grid system too.

Using the mesh is quite easy. To create your common product grid that you see on most e-commerce sites these days, you can initialize it as follows:

<div class="col-container">
  <div class="col-xs-12 col-l-6 col-xl-4">
    Item 1
  </div>
  <div class="col-xs-12 col-l-6 col-xl-4">
    Item 2
  </div>
  ...
</div>

Nesting meshes

You can also nest meshes. Because it utilizes margin collapsing, your grid will always remain aligned perfectly.

<div class="col-container">
  <div class="col-xs-12 col-l-6 col-xl-4">
    <div class="col-container">
      ...
    </div>
  </div>
</div>

Adding spacing between grid elements

You can also add spacing between your grid elements by adding more classes to your grid container element:

<div class="col-container col-container-xs--gap-4--x col-container-xs--gap-2--y">
</div>

Vertically stacking elements within a grid element with perfect spacing

We also can utilize sections to unify margins within a mesh-unit, these will add proper spacing between stacked elements without making the last item overflow and misalign the mesh:

<div class="col-container">
  <div class="col-xs-12 col-l-6 col-xl-4">
    <div class="section-xs-4">
      This element will not have any margin on the top
    </div>
    <div class="section-xs-4">
      This element will have margin on the top to space the elements
    </div>
    <div class="section-xs-4">
      This one too
    </div>
  </div>
</div>

Push and pull

You can also pull and push units, so that you dont have to add garbage units to align something accordingly. So now you dont have to do this:

<div class="col-container">
  <div class="col-xs-5">
  </div>
  <div class="col-xs-7">
  </div>
</div>

But instead you can do this:

<div class="col-container">
  <div class="col-xs-7 col-xs--push-col-5">
  </div>
</div>

mesh's People

Contributors

harm-smits avatar

Stargazers

 avatar

Watchers

 avatar  avatar

mesh's Issues

Spacing using inset and outset

Is your feature request related to a problem? Please describe.
We should consider adding spacing control in some from. A good example of this could be space-inset and space-outset. These could have numbered classes for incremental padding around the object by means of padding.

Describe the solution you'd like
A solution could look like this. Not sure whether I should add them for breakpoints though:

@for $i from 1 through 4 {
  .mesh-space--inset-#{$i} {
    padding: ($i * .4) + rem;
  }
  .mesh-space--outset-#{$i} {
    margin: ($i * -.4) + rem;
  }
}

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.