flexless-mirror
Version:
Less mixins for flexbox layouts.
309 lines (307 loc) • 7.06 kB
CSS
html,
body {
height: 100%;
width: 100%;
box-sizing: border-box;
}
body {
font-family: 'Muli', 'Open Sans', Arial, sans-serif;
height: 100%;
margin: 0;
box-sizing: border-box;
display: -moz-box;
display: -webkit-box;
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
-webkit-box-direction: normal;
-moz-box-direction: normal;
-webkit-flex-direction: column;
-moz-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-pack: center;
-moz-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
justify-content: center;
}
#main {
display: -moz-box;
display: -webkit-box;
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
-webkit-box-flex: 1;
-moz-box-flex: 1;
-webkit-flex: 1 1 0%;
-moz-flex: 1 1 0%;
-ms-flex: 1 1 0%;
flex: 1 1 0%;
}
#main > * {
border: 1px solid #ccc;
padding: 0.25em;
border-radius: 10px;
}
#main > article {
-webkit-box-flex: 1;
-moz-box-flex: 1;
-webkit-flex: 1 0 0px;
-moz-flex: 1 0 0px;
-ms-flex: 1 0 0px;
flex: 1 0 0px;
-webkit-box-ordinal-group: 3;
-moz-box-ordinal-group: 3;
-ms-flex-order: 2;
-webkit-order: 2;
-moz-order: 2;
-ms-order: 2;
order: 2;
margin: 0 10px;
display: -moz-box;
display: -webkit-box;
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
-webkit-box-pack: center;
-moz-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-moz-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
align-items: center;
text-align: center;
}
nav {
display: -moz-box;
display: -webkit-box;
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
-webkit-box-pack: justify;
-moz-box-pack: justify;
-ms-flex-pack: justify;
-webkit-justify-content: space-between;
-moz-justify-content: space-between;
-ms-justify-content: space-between;
justify-content: space-between;
background: gray;
margin-bottom: 10px;
-webkit-box-align: center;
-moz-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
align-items: center;
-webkit-box-flex: none;
-moz-box-flex: none;
-webkit-flex: none 1 0%;
-moz-flex: none 1 0%;
-ms-flex: none 1 0%;
flex: none 1 0%;
}
nav > a {
padding: 15px;
color: white;
display: block;
-webkit-box-flex: 1;
-moz-box-flex: 1;
-webkit-flex: 1 1 0%;
-moz-flex: 1 1 0%;
-ms-flex: 1 1 0%;
flex: 1 1 0%;
margin: auto 10px;
text-decoration: none;
background: blue;
text-align: center;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
min-width: 0;
/* Apparently there's a spec change. Hack for now. */
}
nav > a:first-child {
margin-left: 0;
}
nav > a:last-child {
margin-right: 0;
}
nav > a:hover {
color: red;
}
#main > section {
display: -moz-box;
display: -webkit-box;
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
-webkit-box-orient: horizontal;
-moz-box-orient: horizontal;
-webkit-box-direction: normal;
-moz-box-direction: normal;
-webkit-flex-direction: row;
-moz-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
background: #eee;
width: 200px;
-webkit-box-ordinal-group: 2;
-moz-box-ordinal-group: 2;
-ms-flex-order: 1;
-webkit-order: 1;
-moz-order: 1;
-ms-order: 1;
order: 1;
-webkit-box-flex: 1;
-moz-box-flex: 1;
-webkit-flex: 1 0 0px;
-moz-flex: 1 0 0px;
-ms-flex: 1 0 0px;
flex: 1 0 0px;
}
#main > section > div,
#main > section > div > div {
border: 1px solid #cccccc;
-webkit-box-flex: 1;
-moz-box-flex: 1;
-webkit-flex: 1 1 0%;
-moz-flex: 1 1 0%;
-ms-flex: 1 1 0%;
flex: 1 1 0%;
padding: 0.25em;
margin: 0.25em;
background: white;
display: -moz-box;
display: -webkit-box;
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
-webkit-justify-content: stretch;
-moz-justify-content: stretch;
-ms-justify-content: stretch;
justify-content: stretch;
-webkit-box-align: stretch;
-moz-box-align: stretch;
-ms-flex-align: stretch;
-webkit-align-items: stretch;
-moz-align-items: stretch;
-ms-align-items: stretch;
align-items: stretch;
text-align: center;
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
-webkit-box-direction: normal;
-moz-box-direction: normal;
-webkit-flex-direction: column;
-moz-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
}
#main > section > div > div > .tabs {
display: -moz-box;
display: -webkit-box;
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
margin-bottom: 10px;
-webkit-box-align: center;
-moz-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
align-items: center;
-webkit-box-flex: none;
-moz-box-flex: none;
-webkit-flex: none 1 0%;
-moz-flex: none 1 0%;
-ms-flex: none 1 0%;
flex: none 1 0%;
background: gray;
}
#main > section > div > div > .content {
background: blue;
-webkit-box-flex: 1;
-moz-box-flex: 1;
-webkit-flex: 1 1 0%;
-moz-flex: 1 1 0%;
-ms-flex: 1 1 0%;
flex: 1 1 0%;
display: -moz-box;
display: -webkit-box;
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
}
#main > section > div:first-child {
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
#main > section > div:last-child {
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}
header {
display: -moz-box;
display: -webkit-box;
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
-webkit-box-pack: start;
-moz-box-pack: start;
-ms-flex-pack: start;
-webkit-justify-content: flex-start;
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
justify-content: flex-start;
-webkit-box-align: center;
-moz-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
align-items: center;
-webkit-box-flex: 0;
-moz-box-flex: 0;
-webkit-flex: 0 0 20px;
-moz-flex: 0 0 20px;
-ms-flex: 0 0 20px;
flex: 0 0 20px;
background: #eee;
padding: 1em;
margin: 10px 0;
border-radius: 10px;
color: rgba(0, 0, 0, 0.6);
text-shadow: 0 1px rgba(255, 255, 255, 0.75);
}