Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand use and function of zen-grid-item-width() #21

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jstoller
Copy link
Contributor

@jstoller jstoller commented May 6, 2012

This branch makes the following changes:

  1. The box sizing method check, and corresponding width adjustment, is moved inside the zen-grid-item-width() function itself.
  2. $column-position, $gutter-width and $box-sizing variables are added to the zen-grid-item-width() function's input. The gutter-width and $box-sizing variables are needed for the box sizing method check. The column-position variable is added to enable more advanced features in the future, like grids with variable width columns.
  3. zen-grid-item-width() is now used to calculate the width in the zen-grid-item mixin, as well as the zen-grid-flow-item mixin. It is also used to calculate the margins for grid items.
  4. If zen-grid-item-width() is called without any variables, it will now return the full grid width by default.

In addition to making the zen-grid-item-width() function more useful in its own right, which may have uses outside of the zen-grid mixins themselves, these updates open the door to more seamless future enhancements. For instance, you can now implement a non-equal grid columns by expanding zen-grid-item-width(), without negatively impacting anyone already using this plugin.

@JohnAlbin
Copy link
Owner

Addressing your points:

  1. Absolutely. I wish I had seen these commits before I did that bug fix at bfe88ec. I would have your commit to give you credit. :-)
  2. I agree with you on 2 of the variables. Not sure I see the necessity for $column-position yet.
  3. Yep. That was done in bfe88ec as well.
  4. I don't understand why this is needed. $zen-grid-width already has the full width of the grid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants