Giter Club home page Giter Club logo

components-grid's People

Contributors

giuseppeg avatar jaredhanson avatar jherdman avatar necolas avatar oleersoy avatar quentind avatar simonsmith avatar timkelty 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

components-grid's Issues

Add test file

Include a test.html file (like normalize.css) to act as a test suite.

Grid / Grid-cel ignores u-sizeFull

hei,

i'm having this markup

<div class="Grid Grid--fit Grid--withGutter Grid--equalHeight">
    <div class="Grid-cell u-sizeFull">
        content
    </div>

    <div class="Grid-cell u-size1of2">
        content
    </div>

    <div class="Grid-cell u-size1of2">
        content     
    </div>
</div>  

this is what i get

grid_not_ok

this is the result expected

grid

Update the dev setup

Add the Makefile to take care of multiple commands, and update the test docs (see generator-suit templates).

Grid use of negative margins causes horizontal scrolling

I've been working with SUIT for a while and have noticed that while using the old Grid (inline-block) and the new Grid (flexbox) with "Grid--withGutter" modifier a horizontal scroll appears due to the negative margin. I can set the body to overflow-x: hidden but that seems kind of hacky. Do you have any suggestions?

screen shot 2016-03-30 at 12 59 54 pm

Variables defaults should be set at use, not at top of file

Setting the two --Grid- variables at the top of grid.css makes it impossible to override them without editing a copy of the source.

The default values should be defined when the variables are used. For instance, Line 101 could become:

font-size: var(--Grid-font-size, 1rem);

Placing the defaults at the usage sites will allow for the :root declaration at the top of the file to be removed.

Personally, I dislike the lack of DRYness that this scheme forces upon us, but—to my knowledge—there is no other way to make these values configurable.

Grids browser Compatibility

As far as the doc says the grids should be compatible with

  • Google Chrome (latest)
  • Opera (latest)
  • Firefox 4+
  • Safari 5+
  • Internet Explorer 9+

But it uses variables and support is still very limited: http://caniuse.com/#feat=css-variables

So i don't understand how the grids respect the compatibility specified in the docs.

Consider Grid--fit rename/Grid--distribute

Grid--fit's name can be a bit misleading, particularly because of the name of u-sizeFit.

One might think Grid--fit might be equivalent to:

    <div class="Grid">
      <div class="Grid-cell u-sizeFit">
        <div class="fixture-Box">1</div>
      </div>
      <div class="Grid-cell u-sizeFit">
        <div class="fixture-Box">2</div>
      </div>
      <div class="Grid-cell u-sizeFit">
        <div class="fixture-Box">3</div>
      </div>
    </div>

But it isn't.
Grid--fit distributes cell widths to occupy an entire row equally.

I'm thinking maybe Grid--distribute would be more appropriate? If we wanted to support a "shirinkwrap" grid like the above example, we could repurpose Grid--fit for that.

Otherwise maybe Grid--collapse, or just dropping it all together. It's basically if you were using a standard flexbox, but still wanted your grid gutters (think horizontal list).

Thoughts @simonsmith @giuseppeg?

Reassess approach to whitespace collapsing

WebKit-based browsers prove problematic with certain fonts. The current hack is no longer a robust solution. Probably go back to collapsing the whitespace in the source templates.

inherited font sizes

Maybe I'm not thinking about this correctly but I have a base font size:

html {
  font-size: 10px;
}
body {
  font-size: 1.3rem;
}

Because .Grid-cell has font-size: 1rem it sets everything to 10px how can I have a nicer way for it to inherit my base font sizing?

negative margin makes container larger than it should be

on the .Grid--withGutter class since there is a negative margin it actually draws the container to be larger than it would be without it. by doing this, each grid cell ends up rendering larger than they would without the negative margin.

anyway to fix this?

Layout broken using `Grid--withGutter`, in IE11

Hola,

First of all, this grid is very good, so thank you in advance for creating it 🎩

Being said that, I recently discovered a bug using Internet Explorer 11 (Windows10), in conjunction with the Grid--withGutter modifier class. When using <div class="Grid Grid--withGutter"> within an inner, the last column falls apart.

The problem

Given this code...

HTML

<div class="Wrapper">
  <div class="u-inner">
    <div class="Grid Grid--withGutter">
      <div class="Grid-cell u-lg-size4of12">
        <p>Lorem</p>
      </div>
      <div class="Grid-cell u-lg-size4of12">
        <p>Ipsum</p>
      </div>
      <div class="Grid-cell u-lg-size4of12">
        <p>Dolor</p>
      </div>
    </div>
  </div>
</div>

CSS

* {
  box-sizing: border-box;
}

.Wrapper {
  max-width: 1200px;
  margin: 0 auto;
  background-color: white;
}

.u-inner {
  padding: 64px 16px;
}

p {
  background-color: gold;
}

This is what happens...

grid-with-gutter-ie11-bug

The cause

To be more specific, the problem seems to occur with the width: calc(100% * 1 / 3) !important; calculation (remember, IE11 only):

@media (min-width: 768px) {
  .u-lg-size1of3, .u-lg-size2of6, .u-lg-size4of12 {
    -ms-flex-preferred-size: auto !important;
    flex-basis: auto !important;
    width: calc(100% * 1 / 3) !important;
  }
}

If you take a look at the computed width in Chrome, it results in:

width: 394.656px

On the other hand, IE11 seems to compute this calc in a different way, so it results in:

width: 378.67px;

After some research, I realized IE have some troubles with sub-pixel rounding (just take a look at the "Known issues" tab in Can I use site), so more than likely this could be the cause of the issue.

Have you thought in doing this calculation with a CSS pre-processor (Sass, PostCSS...), to return always the same pixel value?

Cheers

Grid defaulting to font-size zero

I'm attempting to use suitcss with react. I used npm to intstall
"suitcss-components": "^0.3.0", "suitcss-components-grid": "^2.0.2",

I create a base.css that looks like

@import '../../node_modules/suitcss-base';
@import '../../node_modules/suitcss-components-grid';

:root {
  --Grid-font-size: 1em;
  --base-font-size: 16px;
}

Even with the Grid-font-size the default font-size is 0. Therefore, when the grid renders it's not visible. Here is a sample of my react element

var React = require('react');
require('../suit/base.css');
var SuitCss = React.createClass({
  render: function() {
    return (
      <div>
        <div className="Grid [Grid--alignCenter|Grid--alignRight|Grid--alignMiddle|Grid--alignBottom]">
          <div className="Grid-cell u-size1of2 u-lg-size6of12">column 1</div>
          <div className="Grid-cell u-size1of2 u-lg-size4of12">column 2</div>
          <div className="Grid-cell u-size1of3 u-lg-size2of12">column 3</div>
          <div className="Grid-cell u-size1of3"></div>
        </div>
      </div>
    );
  }

});

Even when I change the font-size in dev tools the grid is still not working as I would expect. Is this a bug or something I don't understand about suit?

History.md

Is there any reason there ain't one ?
Would you mind if I add one ?

Use .css for the import in index.css ?

Hi @necolas,

I know that you are using rework-npm or similar, but using a simpler thing like rework-import make unable to parse index.css since the extension is missing (I know I can eventually add automatically the ext, but not sure if I want to ^^).
Why don't you just put the grid in index.css (I try to do that when I get a "small" lib) ?

Fixed column width + fluid one

what would be the correct aproach in order to get the following fluid markup, over the main layout ?

[ aside (containing ad) 300px ] [ fluid (rest of the space) ]

layout

Broken link

Just wanted to let you know the link to the utility SUIT dimensions in your README.md is pointing to an old (and nonexistent?) repo. I believe it should be pointing to: SUIT dimensions

Didn't think it was worth the overhead of a fork and pull request.

I'm a big fan of Normalize.css and find the development of these SUIT utilities quite interesting.

Cheers

Drop .Grid-cell

I tend to think we should drop .Grid-cell and just use .Grid > *, since the nature of flexbox requires that it be a direct child.

Grid-cell--center could then also be dropped in favor of u-flexExpand/u-flexExpandLeft/u-flexRight, which gives you greater flexibility anyway.

Thoughts @simonsmith @giuseppeg?

Remove units

Remove the units now that there is a separate component that handles dimensions. Not sure about including it as a dependency, since people might want to use a different dimension component. But can't hurt, I suppose. Just don't import it.

Fix example code

The cell centering example uses the wrong class. Should be Grid-cell--center

Add mobile/desktop plugins?

Maybe port the "modifiers" from griddle as optional "plugins" that can be sourced if you need to modify the grid for mobile (if starting at desktop) or vice-versa.

Gutter calc to support em/rem

Could you please change the code for gutter calculation in .Grid--withGutter to support variables set in em or rem values:

calc(0.5 * var(--Grid-gutter-size))

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.