KNACSS/sass/utilities/_layout.scss

123 lines
2 KiB
SCSS
Raw Normal View History

/* ----------------------------- */
2016-05-20 08:58:56 +02:00
/* ==Global 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 */
.#{$kna-namespace}left {
2015-07-01 13:47:48 +02:00
margin-right: auto;
}
.#{$kna-namespace}right {
2015-07-01 13:47:48 +02:00
margin-left: auto;
}
.#{$kna-namespace}center {
2015-07-01 13:47:48 +02:00
margin-left: auto;
margin-right: auto;
}
/* text and contents alignment */
.#{$kna-namespace}txtleft {
2015-07-01 13:47:48 +02:00
text-align: left;
}
.#{$kna-namespace}txtright {
2015-07-01 13:47:48 +02:00
text-align: right;
}
.#{$kna-namespace}txtcenter {
2015-07-01 13:47:48 +02:00
text-align: center;
}
/* floating elements */
.#{$kna-namespace}fl {
2015-07-01 13:47:48 +02:00
float: left;
}
img.#{$kna-namespace}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
.#{$kna-namespace}fr {
2015-07-01 13:47:48 +02:00
float: right;
}
img.#{$kna-namespace}fr {
2015-07-01 13:47:48 +02:00
margin-left: $small-value;
}
img.#{$kna-namespace}fl,
img.#{$kna-namespace}fr {
2015-07-01 13:47:48 +02:00
margin-bottom: $tiny-value;
}
/* inline-block */
.#{$kna-namespace}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
*/
2016-06-18 14:31:01 +02:00
[class*="#{$kna-namespace}flex-container"],
.#{$kna-namespace}flex-container{
2015-07-01 13:47:48 +02:00
display : flex;
flex-wrap: wrap;
2015-04-13 16:10:55 +02:00
}
.#{$kna-namespace}flex-container-h {
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
.#{$kna-namespace}flex-container-v {
2015-07-01 13:47:48 +02:00
flex-direction: column;
}
.#{$kna-namespace}flex-item-fluid {
2015-07-01 13:47:48 +02:00
flex: 1;
min-width: 0;
2013-09-12 11:59:14 +02:00
}
2014-05-07 10:45:47 +02:00
.#{$kna-namespace}flex-item-first,
.#{$kna-namespace}grid-item-first {
2015-07-01 13:47:48 +02:00
order : -1;
2013-09-12 11:59:14 +02:00
}
2014-05-07 10:45:47 +02:00
.#{$kna-namespace}flex-item-medium,
.#{$kna-namespace}grid-item-medium {
2015-07-01 13:47:48 +02:00
order : 0;
2013-09-12 11:59:14 +02:00
}
2014-05-07 10:45:47 +02:00
.#{$kna-namespace}flex-item-last,
.#{$kna-namespace}grid-item-last {
2015-07-01 13:47:48 +02:00
order : 1;
2014-05-07 10:45:47 +02:00
}
2015-03-07 14:36:58 +01:00
.#{$kna-namespace}flex-item-center,
.#{$kna-namespace}grid-item-center {
2015-07-01 13:47:48 +02:00
margin: auto;
2015-03-07 14:36:58 +01:00
}