Comments (8)
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.
Realted issue on do: http://drupal.org/node/1593842
from zen-grids.
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.
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.
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.
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.
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.
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)
- Are you the author of Zen Thems for Drupal? HOT 1
- An in-range update of mocha is breaking the build 🚨 HOT 6
- [Request] npm backport for v1.5?
- An in-range update of eyeglass is breaking the build 🚨 HOT 5
- An in-range update of support-for is breaking the build 🚨 HOT 1
- $box-sizing warning despite no support configured for legacy IE browsers HOT 7
- error importing zen-grids/flow HOT 1
- Float right last item HOT 1
- zen-clear seems to not work with IE7 / IE6 HOT 1
- Setting environment documentation HOT 1
- Second column margin-left miscalculation(?) on a 2 column grid HOT 1
- Cannot activate due to conflict HOT 8
- Replace background grid gradients with svg
- Sass '!global' error with recommended gemfile versions HOT 1
- Which is the substitute of zen-nested-container on zg v2 HOT 1
- Please provide a working example of $zen-gutter-method HOT 3
- px must match the units of the grid width HOT 5
- Add support for responsive layouts with margin-based gutters and calc()
- RTL styles are broken
- problem with grid
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zen-grids.