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

create a flexible container width #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,25 @@ $map-grid-props: (
'-xl': $grid__bp-xl
);

/**following bootstrap container media queries, initial container has fixed
container width, while this code is making it flexbile so as to resize
based on screen size**/

$map-container-props: (
$grid__bp-sm,
$grid__bp-md,
$grid__bp-lg,
$grid__bp-xl,
);

@mixin create-container-class($breakpoint){
@include create-mq($breakpoint, 'min'){
.container{
max-width: $breakpoint *1px;
}
}
}

@mixin create-mq($breakpoint, $min-or-max) {
@if($breakpoint == 0) {
@content;
Expand Down Expand Up @@ -55,7 +74,7 @@ $map-grid-props: (
}

.container {
max-width: $grid__bp-md * 1px;
//max-width: $grid__bp-md * 1px;
margin: 0 auto;
&--fluid {
margin: 0;
Expand All @@ -70,3 +89,12 @@ $map-grid-props: (
@include create-col-classes($modifier, $grid__cols, $breakpoint);
}
}

@each $breakpoint in $map-container-props{
@include create-container-class($breakpoint)
};