Skip to content

Instantly share code, notes, and snippets.

@RussellHite
Created October 25, 2017 16:41
Show Gist options
  • Save RussellHite/3e757169647d1ffec445459e94344f8c to your computer and use it in GitHub Desktop.
Save RussellHite/3e757169647d1ffec445459e94344f8c to your computer and use it in GitHub Desktop.
Flex Partials, _flex-maker to live in mixins and _flex for components
@mixin flex-items($number) {
@for $i from 1 through $number{
.flex-#{$i}{
flex: #{$i} 1 1%;
}
}
}
//@include flex-items($number: 12);
@include flex-items($number: 12);
.flex-container {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
[class*="flex-"]{
margin-right: 75px;
}
[class*="flex-"]:last-child{
margin-right: 0;
}
}
//styling specific for tablet
@media only screen and (max-width: $screen-md) {
.flex-1.flex-sm-3{
flex-basis: 33.3333%;
margin-right: 0;
margin-bottom: 45px;
}
.flex-1.flex-sm-6{
flex-basis: 50%;
margin-right: 0;
margin-bottom: 45px;
}
.flex-1.flex-sm-9{
flex-basis: 75%;
margin-right: 0;
margin-bottom: 45px;
}
.flex-1.flex-sm-12{
flex-basis: 100%;
margin-bottom: 45px;
}
}
//styling specific for mobile
@media only screen and (max-width: $screen-sm) {
[class*="flex-"]{
flex-basis: 100%;
margin-bottom: 25px;
}
.flex-1.flex-xs-6{
flex-basis: 50%;
margin-bottom: 25px;
}
.flex-1.flex-xs-12{
flex-basis: 100%;
margin-bottom: 25px;
}
.flex-1.flex-sm-6{
flex-basis: 50%;
margin-right: 0;
margin-bottom: 25px;
}
}
.mx-listview.flex-container ul.mx-list li.mx-listview-item .mx-dataview-content {
display: flex;
justify-content: space-between;
}
.mx-dataview.flex-container .mx-dataview-content {
display: flex;
justify-content: space-between;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment