Browse Source

Adds flexbox ui item

pull/2053/head
jlukic 9 years ago
parent
commit
a99af7b493
2 changed files with 13 additions and 15 deletions
  1. 20
      src/definitions/views/item.less
  2. 8
      src/themes/default/views/item.variables

20
src/definitions/views/item.less

@ -27,8 +27,6 @@
---------------*/ ---------------*/
.ui.items > .item { .ui.items > .item {
table-layout: fixed;
display: @display; display: @display;
margin: @itemSpacing 0em; margin: @itemSpacing 0em;
width: @width; width: @width;
@ -65,9 +63,6 @@
Item Item
---------------*/ ---------------*/
.ui.items > .item {
min-width: 100%;
}
.ui.items > .item:after { .ui.items > .item:after {
display: block; display: block;
content: ' '; content: ' ';
@ -91,12 +86,13 @@
.ui.items > .item > .image { .ui.items > .item > .image {
position: relative; position: relative;
flex: 0 0 auto;
display: @imageDisplay; display: @imageDisplay;
float: @imageFloat; float: @imageFloat;
margin: @imageMargin; margin: @imageMargin;
padding: @imagePadding; padding: @imagePadding;
max-height: @imageMaxHeight; max-height: @imageMaxHeight;
vertical-align: @imageVerticalAlign;
align-self: @imageVerticalAlign;
} }
.ui.items > .item > .image > img { .ui.items > .item > .image > img {
display: block; display: block;
@ -117,6 +113,7 @@
.ui.items > .item > .content { .ui.items > .item > .content {
display: block; display: block;
flex: 1 1 auto;
background: @contentBackground; background: @contentBackground;
margin: @contentMargin; margin: @contentMargin;
padding: @contentPadding; padding: @contentPadding;
@ -138,7 +135,7 @@
width: @contentWidth; width: @contentWidth;
display: @contentDisplay; display: @contentDisplay;
margin-left: @contentOffset; margin-left: @contentOffset;
vertical-align: @contentVerticalAlign;
align-self: @contentVerticalAlign;
padding-left: @contentImageDistance; padding-left: @contentImageDistance;
} }
@ -171,7 +168,7 @@
---------------*/ ---------------*/
.ui.items > .item .content img { .ui.items > .item .content img {
vertical-align: @contentImageVerticalAlign;
align-self: @contentImageVerticalAlign;
width: @contentImageWidth; width: @contentImageWidth;
} }
.ui.items > .item img.avatar, .ui.items > .item img.avatar,
@ -356,6 +353,7 @@
/* Mobily Only */ /* Mobily Only */
@media only screen and (max-width: @largestMobileScreen) { @media only screen and (max-width: @largestMobileScreen) {
.ui.items > .item { .ui.items > .item {
flex-direction: column;
margin: @mobileItemSpacing 0em; margin: @mobileItemSpacing 0em;
} }
.ui.items > .item > .image { .ui.items > .item > .image {
@ -387,13 +385,13 @@
--------------------*/ --------------------*/
.ui.items > .item > .image + [class*="top aligned"].content { .ui.items > .item > .image + [class*="top aligned"].content {
vertical-align: top;
align-self: top;
} }
.ui.items > .item > .image + [class*="middle aligned"].content { .ui.items > .item > .image + [class*="middle aligned"].content {
vertical-align: middle;
align-self: center;
} }
.ui.items > .item > .image + [class*="bottom aligned"].content { .ui.items > .item > .image + [class*="bottom aligned"].content {
vertical-align: bottom;
align-self: bottom;
} }

8
src/themes/default/views/item.variables

@ -10,7 +10,7 @@
@groupMargin: 1.5em 0em; @groupMargin: 1.5em 0em;
/* Item */ /* Item */
@display: table;
@display: flex;
@background: transparent; @background: transparent;
@borderRadius: 0rem; @borderRadius: 0rem;
@minHeight: 0px; @minHeight: 0px;
@ -40,7 +40,7 @@
--------------------*/ --------------------*/
/* Image */ /* Image */
@imageDisplay: table-cell;
@imageDisplay: block;
@imageFloat: none; @imageFloat: none;
@imageMaxHeight: ''; @imageMaxHeight: '';
@imageVerticalAlign: top; @imageVerticalAlign: top;
@ -52,10 +52,10 @@
@imageBorder: none; @imageBorder: none;
/* Content */ /* Content */
@contentDisplay: table-cell;
@contentDisplay: block;
@contentVerticalAlign: top; @contentVerticalAlign: top;
@contentWidth: 100%;
@contentWidth: auto;
@contentOffset: 0em; @contentOffset: 0em;
@contentBackground: none; @contentBackground: none;
@contentMargin: 0em; @contentMargin: 0em;

Loading…
Cancel
Save