1
0
mirror of https://github.com/bigchaindb/site.git synced 2024-11-25 11:08:29 +01:00
site/_src/_assets/styles/bigchain/_grid.scss

270 lines
4.5 KiB
SCSS
Raw Normal View History

//
// Grid
// --------------
2017-05-29 21:15:48 +02:00
// bigchaindb.com
//
// adapted from github.com/kremalicious/kremalicious3/blob/master/_src/_assets/styl/grid.styl
//
//
// More sane box model
//
*,
*:before,
*:after {
box-sizing: border-box;
}
//
// Base
//
.grid {
display: flex;
flex-wrap: wrap;
list-style: none;
margin: 0;
padding: 0;
}
.grid__col {
flex: 1;
// Firefox grid fix for whatever reason
min-height: 0;
min-width: 0;
}
.row {
2017-05-18 19:33:14 +02:00
max-width: calc(50em - #{$gutter-space * 2});
margin-left: auto;
margin-right: auto;
2016-02-01 16:37:58 +01:00
padding-left: ($gutter-space / 2);
padding-right: ($gutter-space / 2);
@media ($screen-sm) {
padding-left: $gutter-space;
padding-right: $gutter-space;
}
}
.row--wide {
max-width: 70rem;
}
2016-02-14 00:16:24 +01:00
.row--narrow {
max-width: ($screen-md-min / 1.75);
}
//
// Alignment per row
//
.grid--top {
2017-05-31 00:22:14 +02:00
align-items: flex-start;
}
.grid--bottom {
2017-05-31 00:22:14 +02:00
align-items: flex-end;
}
.grid--center {
2017-05-31 00:22:14 +02:00
align-items: center;
}
.grid--justifycenter {
2017-05-31 00:22:14 +02:00
justify-content: center;
}
//
// Alignment per cell
//
.grid__col--top {
2017-05-31 00:22:14 +02:00
align-self: flex-start;
}
.grid__col--bottom {
2017-05-31 00:22:14 +02:00
align-self: flex-end;
}
.grid__col--center {
2017-05-31 00:22:14 +02:00
align-self: center;
}
//
// Gutters
//
2016-01-30 13:56:00 +01:00
@mixin grid-gutters() {
margin: -($gutter-space) 0 $gutter-space (-($gutter-space));
> .grid__col {
2017-05-31 00:22:14 +02:00
padding: $gutter-space 0 0 $gutter-space;
}
}
@mixin grid-gutters-small() {
margin: -($gutter-space / 3) 0 $gutter-space / 3 (-($gutter-space / 3));
> .grid__col {
padding: $gutter-space / 3 0 0 $gutter-space / 3;
}
}
2017-05-31 00:22:14 +02:00
.grid--gutters {
2016-01-30 13:56:00 +01:00
@include grid-gutters();
}
.grid--gutters--small {
@include grid-gutters-small();
}
@media ($screen-sm) {
.grid-small--gutters {
2016-01-30 13:56:00 +01:00
@include grid-gutters();
}
.grid-small--gutters--small {
@include grid-gutters-small();
}
}
@media ($screen-md) {
.grid-medium--gutters {
2016-01-30 13:56:00 +01:00
@include grid-gutters();
}
.grid-medium--gutters--small {
@include grid-gutters-small();
}
}
@media ($screen-lg) {
.grid-large--gutters {
2016-01-30 13:56:00 +01:00
@include grid-gutters();
}
.grid-large--gutters--small {
@include grid-gutters-small();
}
}
//
// Columns
//
2016-01-30 13:56:00 +01:00
@mixin grid-columns() {
> .grid__col {
max-width: none;
2016-01-30 13:56:00 +01:00
&.grid__col--1 { flex: 0 0 16%; }
2017-08-22 00:50:41 +02:00
&.grid__col--2 { flex: 0 0 25%; }
2016-01-30 13:56:00 +01:00
&.grid__col--3 { flex: 0 0 50%; }
2017-08-22 00:50:41 +02:00
&.grid__col--4 { flex: 0 0 75%; }
2016-01-30 13:56:00 +01:00
&.grid__col--5 { flex: 0 0 84%; }
&.grid__col--6 { flex: 0 0 100%; }
&.grid__col--2-3 { flex: 0 0 (100% / 1.5); }
&.grid__col--1-3 { flex: 0 0 (100% / 3); }
2016-01-30 13:56:00 +01:00
}
}
.grid--fit {
> .grid__col { flex: 1; }
}
.grid--full {
> .grid__col { flex: 0 0 100%; }
}
.grid--third {
2016-02-08 16:14:23 +01:00
> .grid__col { flex: 0 0 33.3%; }
}
.grid--half {
> .grid__col {
flex: 0 0 50%;
max-width: 50%; // IE 11 workaround for bug (flex-basis doesn't account for box-sizing:border-box)
}
}
2016-01-30 13:56:00 +01:00
.grid--columns {
@include grid-columns();
}
@media ($screen-sm) {
2016-01-30 13:56:00 +01:00
.grid-small--columns {
@include grid-columns();
}
2017-05-31 00:22:14 +02:00
.grid-small--fit {
> .grid__col { flex: 1; }
}
2017-05-31 00:22:14 +02:00
.grid-small--full {
> .grid__col { flex: 0 0 100%; }
}
2017-05-31 00:22:14 +02:00
.grid-small--third {
2016-02-08 16:14:23 +01:00
> .grid__col { flex: 0 0 33.3%; }
}
2017-05-31 00:22:14 +02:00
.grid-small--half {
> .grid__col {
flex: 0 0 50%;
max-width: 50%; // IE 11 workaround for bug (flex-basis doesn't account for box-sizing:border-box)
}
}
}
@media ($screen-md) {
2016-01-30 13:56:00 +01:00
.grid-medium--columns {
@include grid-columns();
}
2017-05-31 00:22:14 +02:00
.grid-medium--fit {
2017-05-31 00:22:14 +02:00
> .grid__col { flex: 1; }
}
2017-05-31 00:22:14 +02:00
.grid-medium--full {
> .grid__col { flex: 0 0 100%; }
}
2017-05-31 00:22:14 +02:00
.grid-medium--third {
2016-02-08 16:14:23 +01:00
> .grid__col { flex: 0 0 33.3%; }
}
2017-05-31 00:22:14 +02:00
.grid-medium--half {
> .grid__col {
flex: 0 0 50%;
max-width: 50%; // IE 11 workaround for bug (flex-basis doesn't account for box-sizing:border-box)
}
}
}
@media ($screen-lg) {
2016-01-30 13:56:00 +01:00
.grid-large--columns {
@include grid-columns();
}
2017-05-31 00:22:14 +02:00
.grid-large--fit {
> .grid__col { flex: 1; }
}
2017-05-31 00:22:14 +02:00
.grid-large--full {
> .grid__col { flex: 0 0 100%; }
}
2017-05-31 00:22:14 +02:00
.grid-large--third {
2016-02-08 16:14:23 +01:00
> .grid__col { flex: 0 0 33.3%; }
}
2017-05-31 00:22:14 +02:00
.grid-large--half {
> .grid__col {
flex: 0 0 50%;
max-width: 50%; // IE 11 workaround for bug (flex-basis doesn't account for box-sizing:border-box)
}
}
}