Coder Social home page Coder Social logo

Comments (8)

marcvangend avatar marcvangend commented on May 14, 2024

Yes! I would like to be able to choose between margin and padding to create the gutters. Sometimes I want to add a border around a grid item, but right now (without an additional inner div) the gutters end up inside the border.

from zen-grids.

thamas avatar thamas commented on May 14, 2024

Realted issue on do: http://drupal.org/node/1593842

from zen-grids.

echozone avatar echozone commented on May 14, 2024

I'm often using background colors for demos, but it would not be worth %-based gutters! I usually find that Drupal has inner elements to use, like .block or article. How does this work for other's use cases?

from zen-grids.

perceptbe avatar perceptbe commented on May 14, 2024

The option to switch certainly would be nice ... I'm used to Omega theme (Drupal) which uses the margin approach so the transition from Omega to Zen would be a littler easyer. Still, like Echozone said, Drupal does have the tendency to add a few inner-div's here and there :)

from zen-grids.

marcvangend avatar marcvangend commented on May 14, 2024

I think we should keep focus on Zen Grids here, which is (despite the obvious strong connections) independent from Drupal. A grid system like this should be usable on all valid markup.

from zen-grids.

JohnAlbin avatar JohnAlbin commented on May 14, 2024

So I've been hacking a way at the complicated code to make this work. Supporting a nested grid when %-based gutters is really hard because the % refers to the parent grid, not the nested grid.

While daydreaming the other week, I came up with an idea that may make the "gutters as margins" idea obsolete. What we all want is a way to not have padding on the grid items. We don't necessarily want %-based gutters.

What if we could have our cake and eat it too? Fixed-width gutters (px, rem, etc.), fluid %-based grid, but no padding on our grid items!

We can do that if we add up all the gutters for all columns and applied it to the container as padding. Then the %-based grid items will be based off the remaining content width of the container. And we use position: relative to move the grid items around from their default positioning and into the right column alignments.

from zen-grids.

JohnAlbin avatar JohnAlbin commented on May 14, 2024

We can do that if we add up all the gutters for all columns and applied it to the container as padding. Then the %-based grid items will be based off the remaining content width of the container. And we use position: relative to move the grid items around from their default positioning and into the right column alignments.

Alas, that was a pipe dream. When I went to implement it, I realized I hadn't taken into account grid items that span multiple columns; the width of those grid items would be some percentage of the container plus some multiple of the gutter size (of any unit). And you can't add % units plus a fixed unit (without using calc()). FAIL.

Anyway, no cake + eating cake. But I can still implement the standard %-based grid item widths with %-based gutters.

from zen-grids.

JohnAlbin avatar JohnAlbin commented on May 14, 2024

I've completed this in a feature branch. But I've promised myself that I'd keep the docs 100% in sync with the code in master, so I'm going to delay merging this feature temporarily. If you are interested, check out the zen-gutter-method branch. https://github.com/JohnAlbin/zen-grids/tree/zen-gutter-method

This feature should land this weekend.

from zen-grids.

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.