KNACSS/sass/_library/_layout.scss

132 lines
1.6 KiB
SCSS
Raw Normal View History

/* ----------------------------- */
/* ==Global Micro Layout */
/* ----------------------------- */
/* module, gains superpower "BFC" Block Formating Context */
2015-12-12 11:20:29 +01:00
.mod,
.bfc {
2015-07-01 13:47:48 +02:00
overflow: hidden;
2013-09-12 11:59:14 +02:00
}
2014-05-07 10:45:47 +02:00
/* blocks that needs to be placed under floats */
.clear {
2015-07-01 13:47:48 +02:00
clear: both;
}
/* blocks that must contain floats */
.clearfix {
2015-07-01 13:47:48 +02:00
&::after {
content: "";
display: table;
clear: both;
border-collapse: collapse;
}
}
/* simple blocks alignment */
2017-07-31 11:45:22 +02:00
.left {
2015-07-01 13:47:48 +02:00
margin-right: auto;
}
2017-07-31 11:45:22 +02:00
.right {
2015-07-01 13:47:48 +02:00
margin-left: auto;
}
2017-07-31 11:45:22 +02:00
.center {
2015-07-01 13:47:48 +02:00
margin-left: auto;
margin-right: auto;
}
/* text and contents alignment */
2017-07-31 11:45:22 +02:00
.txtleft {
2015-07-01 13:47:48 +02:00
text-align: left;
}
2017-07-31 11:45:22 +02:00
.txtright {
2015-07-01 13:47:48 +02:00
text-align: right;
}
2017-07-31 11:45:22 +02:00
.txtcenter {
2015-07-01 13:47:48 +02:00
text-align: center;
}
/* floating elements */
2017-07-31 11:45:22 +02:00
.fl {
2015-07-01 13:47:48 +02:00
float: left;
}
2017-07-31 11:45:22 +02:00
img.fl {
2015-07-01 13:47:48 +02:00
margin-right: $small-value;
2013-09-12 11:59:14 +02:00
}
2014-05-07 10:45:47 +02:00
2017-07-31 11:45:22 +02:00
.fr {
2015-07-01 13:47:48 +02:00
float: right;
}
2017-07-31 11:45:22 +02:00
img.fr {
2015-07-01 13:47:48 +02:00
margin-left: $small-value;
}
2017-07-31 11:45:22 +02:00
img.fl,
img.fr {
2015-07-01 13:47:48 +02:00
margin-bottom: $tiny-value;
}
/* inline-block */
2017-07-31 11:45:22 +02:00
.inbl {
2015-07-01 13:47:48 +02:00
display: inline-block;
vertical-align: top;
}
/* flexbox layout
http://www.alsacreations.com/tuto/lire/1493-css3-flexbox-layout-module.html
*/
2017-07-31 11:45:22 +02:00
[class*="flex-container"],
.flex-container,
2017-06-21 10:50:33 +02:00
.d-flex {
display: flex;
2015-07-01 13:47:48 +02:00
flex-wrap: wrap;
2015-04-13 16:10:55 +02:00
}
2017-07-31 11:45:22 +02:00
.flex-container-h,
2017-06-21 10:50:33 +02:00
.flex-row {
2015-07-01 13:47:48 +02:00
flex-direction: row;
2013-09-12 11:59:14 +02:00
}
2014-05-07 10:45:47 +02:00
2017-08-01 09:23:51 +02:00
.flex-row-reverse {
flex-direction: row-reverse;
2017-08-01 09:36:57 +02:00
justify-content: flex-end;
2017-08-01 09:23:51 +02:00
}
2017-07-31 11:45:22 +02:00
.flex-container-v,
2017-06-21 10:50:33 +02:00
.flex-column {
2015-07-01 13:47:48 +02:00
flex-direction: column;
}
2017-08-02 14:28:24 +02:00
.flex-item-fluid,
.item-fluid {
2015-07-01 13:47:48 +02:00
flex: 1;
2013-09-12 11:59:14 +02:00
}
2014-05-07 10:45:47 +02:00
2017-07-31 11:45:22 +02:00
.flex-item-first,
.item-first {
order: -1;
2013-09-12 11:59:14 +02:00
}
2014-05-07 10:45:47 +02:00
2017-07-31 11:45:22 +02:00
.flex-item-medium,
.item-medium {
order: 0;
2013-09-12 11:59:14 +02:00
}
2014-05-07 10:45:47 +02:00
2017-07-31 11:45:22 +02:00
.flex-item-last,
.item-last {
order: 1;
2014-05-07 10:45:47 +02:00
}
2015-03-07 14:36:58 +01:00
2017-07-31 11:45:22 +02:00
.flex-item-center,
.item-center,
2017-06-21 10:50:33 +02:00
.mr-auto {
2015-07-01 13:47:48 +02:00
margin: auto;
2015-03-07 14:36:58 +01:00
}