flexbox.less
201 lines
| 3.7 KiB
| text/x-less
|
LessCssLexer
Bussonnier Matthias
|
r9271 | |||
/* Flexible box model classes */ | ||||
/* Taken from Alex Russell http://infrequently.org/2009/08/css-3-progress/ */ | ||||
Matthias BUSSONNIER
|
r9284 | |||
Jonathan Frederic
|
r15250 | /* This file is a compatability layer. It allows the usage of flexible box | ||
model layouts accross multiple browsers, including older browsers. The newest, | ||||
universal implementation of the flexible box model is used when available (see | ||||
`Modern browsers` comments below). Browsers that are known to implement this | ||||
new spec completely include: | ||||
Firefox 28.0+ | ||||
Chrome 29.0+ | ||||
Internet Explorer 11+ | ||||
Opera 17.0+ | ||||
Browsers not listed, including Safari, are supported via the styling under the | ||||
`Old browsers` comments below. | ||||
*/ | ||||
Bussonnier Matthias
|
r9271 | .hbox { | ||
Jonathan Frederic
|
r15250 | /* Old browsers */ | ||
Brian E. Granger
|
r13696 | display: -webkit-box; | ||
-webkit-box-orient: horizontal; | ||||
-webkit-box-align: stretch; | ||||
Matthias BUSSONNIER
|
r9284 | |||
Brian E. Granger
|
r13696 | display: -moz-box; | ||
-moz-box-orient: horizontal; | ||||
-moz-box-align: stretch; | ||||
Matthias BUSSONNIER
|
r9284 | |||
Brian E. Granger
|
r13696 | display: box; | ||
box-orient: horizontal; | ||||
box-align: stretch; | ||||
Jonathan Frederic
|
r15119 | |||
Jonathan Frederic
|
r15250 | /* Modern browsers */ | ||
Jonathan Frederic
|
r15119 | display: flex; | ||
flex-direction: row; | ||||
Jonathan Frederic
|
r15258 | align-items: stretch; | ||
Bussonnier Matthias
|
r9271 | } | ||
Matthias BUSSONNIER
|
r9284 | |||
Bussonnier Matthias
|
r9271 | .hbox > * { | ||
Jonathan Frederic
|
r15250 | /* Old browsers */ | ||
Brian E. Granger
|
r13696 | -webkit-box-flex: 0; | ||
-moz-box-flex: 0; | ||||
box-flex: 0; | ||||
Jonathan Frederic
|
r15250 | |||
/* Modern browsers */ | ||||
flex: none; | ||||
Bussonnier Matthias
|
r9271 | } | ||
Matthias BUSSONNIER
|
r9284 | |||
Bussonnier Matthias
|
r9271 | .vbox { | ||
Jonathan Frederic
|
r15250 | /* Old browsers */ | ||
Brian E. Granger
|
r13696 | display: -webkit-box; | ||
-webkit-box-orient: vertical; | ||||
-webkit-box-align: stretch; | ||||
display: -moz-box; | ||||
-moz-box-orient: vertical; | ||||
-moz-box-align: stretch; | ||||
display: box; | ||||
box-orient: vertical; | ||||
box-align: stretch; | ||||
/* width must be 100% to force FF to behave like webkit */ | ||||
width: 100%; | ||||
Jonathan Frederic
|
r15119 | |||
Jonathan Frederic
|
r15250 | /* Modern browsers */ | ||
Jonathan Frederic
|
r15119 | display: flex; | ||
flex-direction: column; | ||||
Jonathan Frederic
|
r15258 | align-items: stretch; | ||
Bussonnier Matthias
|
r9271 | } | ||
Matthias BUSSONNIER
|
r9284 | |||
Bussonnier Matthias
|
r9271 | .vbox > * { | ||
Jonathan Frederic
|
r15250 | /* Old browsers */ | ||
Brian E. Granger
|
r13696 | -webkit-box-flex: 0; | ||
-moz-box-flex: 0; | ||||
box-flex: 0; | ||||
Jonathan Frederic
|
r15250 | |||
/* Modern browsers */ | ||||
flex: none; | ||||
Bussonnier Matthias
|
r9271 | } | ||
Matthias BUSSONNIER
|
r9284 | |||
Bussonnier Matthias
|
r9271 | .reverse { | ||
Jonathan Frederic
|
r15250 | /* Old browsers */ | ||
Brian E. Granger
|
r13696 | -webkit-box-direction: reverse; | ||
-moz-box-direction: reverse; | ||||
box-direction: reverse; | ||||
Jonathan Frederic
|
r15250 | |||
/* Modern browsers */ | ||||
flex-direction: row-reverse; | ||||
Bussonnier Matthias
|
r9271 | } | ||
Matthias BUSSONNIER
|
r9284 | |||
Bussonnier Matthias
|
r9271 | .box-flex0 { | ||
Jonathan Frederic
|
r15250 | /* Old browsers */ | ||
Brian E. Granger
|
r13696 | -webkit-box-flex: 0; | ||
-moz-box-flex: 0; | ||||
box-flex: 0; | ||||
Jonathan Frederic
|
r15250 | |||
/* Modern browsers */ | ||||
flex: none; | ||||
Jonathan Frederic
|
r15253 | width: auto; | ||
Bussonnier Matthias
|
r9271 | } | ||
Matthias BUSSONNIER
|
r9284 | |||
Matthias BUSSONNIER
|
r10218 | .box-flex1 { | ||
Jonathan Frederic
|
r15250 | /* Old browsers */ | ||
Brian E. Granger
|
r13696 | -webkit-box-flex: 1; | ||
-moz-box-flex: 1; | ||||
box-flex: 1; | ||||
Jonathan Frederic
|
r15250 | |||
/* Modern browsers */ | ||||
Jonathan Frederic
|
r15119 | flex: 1; | ||
Bussonnier Matthias
|
r9271 | } | ||
Matthias BUSSONNIER
|
r9284 | |||
Matthias BUSSONNIER
|
r10218 | .box-flex { | ||
Jonathan Frederic
|
r15250 | /* Old browsers */ | ||
Matthias BUSSONNIER
|
r10218 | .box-flex1(); | ||
} | ||||
Bussonnier Matthias
|
r9271 | .box-flex2 { | ||
Jonathan Frederic
|
r15250 | /* Old browsers */ | ||
Brian E. Granger
|
r13696 | -webkit-box-flex: 2; | ||
-moz-box-flex: 2; | ||||
box-flex: 2; | ||||
Jonathan Frederic
|
r15250 | |||
/* Modern browsers */ | ||||
Jonathan Frederic
|
r15119 | flex: 2; | ||
Bussonnier Matthias
|
r9271 | } | ||
Matthias BUSSONNIER
|
r9284 | |||
Bussonnier Matthias
|
r9271 | .box-group1 { | ||
Jonathan Frederic
|
r15250 | /* Deprecated */ | ||
Brian E. Granger
|
r13696 | -webkit-box-flex-group: 1; | ||
-moz-box-flex-group: 1; | ||||
box-flex-group: 1; | ||||
Bussonnier Matthias
|
r9271 | } | ||
Matthias BUSSONNIER
|
r9284 | |||
Bussonnier Matthias
|
r9271 | .box-group2 { | ||
Jonathan Frederic
|
r15250 | /* Deprecated */ | ||
Brian E. Granger
|
r13696 | -webkit-box-flex-group: 2; | ||
-moz-box-flex-group: 2; | ||||
box-flex-group: 2; | ||||
Bussonnier Matthias
|
r9271 | } | ||
Matthias BUSSONNIER
|
r9284 | |||
Bussonnier Matthias
|
r9271 | .start { | ||
Jonathan Frederic
|
r15250 | /* Old browsers */ | ||
Brian E. Granger
|
r13696 | -webkit-box-pack: start; | ||
-moz-box-pack: start; | ||||
box-pack: start; | ||||
Jonathan Frederic
|
r15250 | |||
/* Modern browsers */ | ||||
Jonathan Frederic
|
r15119 | justify-content: flex-start; | ||
Bussonnier Matthias
|
r9271 | } | ||
Matthias BUSSONNIER
|
r9284 | |||
Bussonnier Matthias
|
r9271 | .end { | ||
Jonathan Frederic
|
r15250 | /* Old browsers */ | ||
Brian E. Granger
|
r13696 | -webkit-box-pack: end; | ||
-moz-box-pack: end; | ||||
box-pack: end; | ||||
Jonathan Frederic
|
r15250 | |||
/* Modern browsers */ | ||||
Jonathan Frederic
|
r15119 | justify-content: flex-end; | ||
Bussonnier Matthias
|
r9271 | } | ||
Matthias BUSSONNIER
|
r9284 | |||
Bussonnier Matthias
|
r9271 | .center { | ||
Jonathan Frederic
|
r15250 | /* Old browsers */ | ||
Brian E. Granger
|
r13696 | -webkit-box-pack: center; | ||
-moz-box-pack: center; | ||||
box-pack: center; | ||||
Jonathan Frederic
|
r15250 | |||
/* Modern browsers */ | ||||
Jonathan Frederic
|
r15119 | justify-content: center; | ||
Bussonnier Matthias
|
r9271 | } | ||
Jonathan Frederic
|
r14333 | |||
Jonathan Frederic
|
r14335 | .align-start { | ||
Jonathan Frederic
|
r15250 | /* Old browsers */ | ||
Jonathan Frederic
|
r15130 | -webkit-box-align: start; | ||
-moz-box-align: start; | ||||
box-align: start; | ||||
Jonathan Frederic
|
r15250 | |||
/* Modern browsers */ | ||||
align-items: flex-start; | ||||
Jonathan Frederic
|
r14333 | } | ||
Jonathan Frederic
|
r14335 | .align-end { | ||
Jonathan Frederic
|
r15250 | /* Old browsers */ | ||
Jonathan Frederic
|
r15130 | -webkit-box-align: end; | ||
-moz-box-align: end; | ||||
box-align: end; | ||||
Jonathan Frederic
|
r15250 | |||
/* Modern browsers */ | ||||
align-items: flex-end; | ||||
Jonathan Frederic
|
r14333 | } | ||
Jonathan Frederic
|
r14335 | .align-center { | ||
Jonathan Frederic
|
r15250 | /* Old browsers */ | ||
Jonathan Frederic
|
r15130 | -webkit-box-align: center; | ||
-moz-box-align: center; | ||||
box-align: center; | ||||
Jonathan Frederic
|
r15250 | |||
/* Modern browsers */ | ||||
align-items: center; | ||||
Jonathan Frederic
|
r14333 | } | ||