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

SCSS calculation fixes #63

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

SCSS calculation fixes #63

wants to merge 8 commits into from

Conversation

bhcarpenter
Copy link

This series of commits updates the SCSS version. It includes the following:

  • Fixes the nested column problem (yes, it was still happening).
  • Updates calculations of row width and push/pull margin size to match what I think the correct behavior should be.
  • Cleans up the calculations so that they are easier to understand.
  • Adds some simple tests

Please feel free to discuss and ask questions.

Brandon Carpenter added 8 commits May 14, 2012 16:22
- Fixed bug where the overall column width was shadowed by a parameter
  name.
- Removed the (unnecessary) second parameter to column(). The
  value was used to calculate the ratio of $total-width/$calculated-width
  for fluid-width purposes, and therefore should always use the global
  $column count.
The gridsystem-ratio() function calculates the ratio of the
user-specified $total-width, to the calculated grid width.

This ratio was used in every width calculation, and rewriting the
calculations using this gridsystem-ratio() made their purposes much more
obvious.
gridsystem-width() already calculates the width with the outer margin
included. Adding the gutter again makes the width of the row too large.
An expression in the column width calculation was mathematically
equivalent to the value calculated by gridsystem-width(), so I replaced
it with a call to that function.
Just as in the width calculation for column(), the push and pull mixins
contained an expression that was mathematically equivalent to the value
calculated by gridsystem-width(), so I replaced it with a call to that
function.
The previous formula for calculating push/pull margins was incorrect.
The correct behavior is for the push/pull margin of $x to be equivalent
to the width of column($x) plus half of the gutter.

The formula could be simplified further, but I feel that writing it this
way emphesises the relationship to the column width formula.
It didn't take changing default values into account. I updated it to
recalculate the "default width" every time.
- Using 960.gs as a benchmark for what the column widths that are
  generated should be.
- Ensure that the row widths are calculated correctly in relation to the
  column widths.
@abepetrillo
Copy link

👍

1 similar comment
@kfalkiewicz
Copy link

👍

@ghost
Copy link

ghost commented Dec 9, 2012

+1.png

@kfalkiewicz
Copy link

I created SCSS only repo of Semantic.gs with those changes, because I didn't want to wait for ages. All rights reserverd for bhcarpenter (who done this changes and send them here) and for tylertate who is author of Semantic.gs. I only merged changes with newest version of Semantic.gs and remove unnecessary things (I didn't merged tests also, because I don't use them at all).

Link: https://github.com/Nosenation/Light-SCSS-Semantic.gs

@yckart
Copy link

yckart commented Dec 12, 2012

As already to @Nosenation asked. Any ideas how to accomplish this changes with fluid layouts? It breaks if $total-width is 100%: http://codepen.io/yckart/pen/kEact

@kfalkiewicz
Copy link

@yckart Problem is fixed in my repo. 😄

@TobyHowarth
Copy link

This is awesome as have been looking for the fixes for the exact issue, thanks guys !

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

Successfully merging this pull request may close these issues.

5 participants