Skip to content

Flexible percentage based grids with fixed pixel gutters #20

Description

@Rolf-Herbert

Hi there,

Not an issue as such just a modification I have added to enable a fluid grid to have fixed gutters..this relies on calc so IE9 up.

.grid-column-width(@n) {
//width: @column-width * @n - (@column-margin*(@total-columns - @n)/@total-columns);
width: calc( ~ "@{column-width}% * @{n} - ( @{global-gutter} - ( (@{global-gutter} / @{total-columns}) * @{n} ) ) ");
}

and

.column,
.columns {
    //margin-left: @column-margin;
    margin-left: @global-gutter;
}

Need to provide the @global-gutter variable in PX and also
You also need an uptodate less compiler so that it does not perform the calculation inside the calc brackets.

Just thought it might be useful to some people.

Thanks
Rolf

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions