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

Why does $baseColWidth have to be set manually and not automatically? #7

Closed
sebastian-ruiz opened this issue Aug 30, 2013 · 2 comments
Assignees

Comments

@sebastian-ruiz
Copy link

In the _var.scss, $baseColWidth: 40px, for when the $baseWidth: 960px.
However, supposing we wanted to have a $baseWidth of 1200px, we would have to change $baseColWidth: 55px.

May I suggest the following:

$baseColWidth: ($baseWidth/$baseColCount) - $baseGutterWidth;

This could also be applied in the @mixin _fixedGrid, used in _dependencies.scss, which would mean the 28px value could be removed in skeleton.scss:

@include grid($tabletWidth, false, 28px); // 28px no longer necessary if $colWidth set dynamically.
@ghost ghost assigned atomicpages Sep 1, 2013
@atomicpages
Copy link
Owner

Love it, @vephinx ! Making this happen now!

@atomicpages
Copy link
Owner

Update, since @include grid() can be called without parameters, we need the defaults to stay in _vars.scss. We can run the calculations inside the grid mixin since _fixedGrid takes $width, $colWidth, $gutterWidth, $colCount as parameters. We can simply remove the $colWidth parameter from grid like so:

@mixin grid($width: $baseWidth, $fluid: $isFluid, $gutterWidth: $baseGutterWidth, $colCount: $baseColCount) {
    @if ( $fluid == true ) {
        @include _fluidGrid($colCount);
    } @else {
        // we no longer need to set a value for $colWdith because it is generated dynamically in _dependencies.scss
        // @see https://github.com/atomicpages/skeleton-sass/issues/7
        $colWidth: ($width / $colCount) - $gutterWidth;
        @include _fixedGrid($width, $colWidth, $gutterWidth, $colCount);
    }
}

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

No branches or pull requests

2 participants