Warning, /webapps/ocs-webserver/httpdocs/theme/flatui/less/flex-layout.less is written in an unsupported language. File is not indexed.
0001 @flex-column: 24;
0002
0003 .flex-clearfix() {
0004 &:before, &:after {
0005 content: " ";
0006 display: flex;
0007 box-sizing: border-box;
0008 width: 0;
0009 height: 0;
0010 font-size: 0;
0011 }
0012 &:after {
0013 clear: both;
0014 }
0015 }
0016
0017 .flex-column, .flex-row {
0018 display: flex;
0019 flex-wrap: wrap;
0020 .flex-clearfix();
0021 }
0022 .flex-column {
0023 flex-direction: row;
0024 }
0025 .flex-row {
0026 flex-direction: column;
0027 }
0028 .flex-around {
0029 justify-content: space-around;
0030 }
0031 .flex-between {
0032 justify-content: space-between;
0033 }
0034 .flex-baseline {
0035 align-items: baseline;
0036 }
0037 .flex-strech {
0038 align-items: stretch;
0039 }
0040
0041 .flex-item {
0042 flex-grow: 1;
0043 }
0044
0045 // 递归生成栅格
0046 .build-item(@i) when (@i > 0) {
0047 .build-item((@i - 1));
0048
0049 // 栅格
0050 .flex-item-@{i} {
0051 width: percentage(@i / @flex-column);
0052 }
0053
0054 // 向左偏移
0055 .flex-offset-@{i} {
0056 margin-left: percentage(@i / @flex-column);
0057 }
0058
0059 // 排序
0060 .flex-order-@{i} {
0061 order: @i;
0062 }
0063 }
0064
0065 .build-item(@flex-column);
0066
0067 // flex-row的对齐方式
0068 .build-align(@type) when (@type = row) {
0069 &.flex-left {
0070 align-items: flex-start;
0071 }
0072 &.flex-right {
0073 align-items: flex-end;
0074 }
0075 &.flex-top {
0076 justify-content: flex-start;
0077 }
0078 &.flex-bottom {
0079 justify-content: flex-end;
0080 }
0081 &.flex-center {
0082 align-items: center;
0083 }
0084 &.flex-middle {
0085 justify-content: center;
0086 }
0087 }
0088 // flex-column的对齐方式
0089 .build-align(@type) when (@type = column) {
0090 &.flex-left {
0091 justify-content: flex-start;
0092 }
0093 &.flex-right {
0094 justify-content: flex-end;
0095 }
0096 &.flex-top {
0097 align-items: flex-start;
0098 }
0099 &.flex-bottom {
0100 align-items: flex-end;
0101 }
0102 &.flex-center {
0103 justify-content: center;
0104 }
0105 &.flex-middle {
0106 align-items: center;
0107 }
0108 }
0109
0110 .flex-column {
0111 .build-align(column);
0112 }
0113 .flex-row {
0114 .build-align(row);
0115 }
0116
0117 [class*=flex-item] {
0118 &.flex-left {
0119 margin-right: auto;
0120 }
0121 &.flex-right {
0122 margin-left: auto;
0123 }
0124 &.flex-top {
0125 margin-bottom: auto;
0126 }
0127 &.flex-bottom {
0128 margin-top: auto;
0129 }
0130 &.flex-center {
0131 margin-left: auto;
0132 margin-right: auto;
0133 }
0134 &.flex-middle {
0135 margin-top: auto;
0136 margin-bottom: auto;
0137 }
0138 }
0139
0140 .flex-sm-show, .flex-md-show {
0141 display: none;
0142 }
0143
0144 @media (max-width: 992px) {
0145 .flex-md {
0146 flex-direction: column;
0147 .build-align(row);
0148
0149 [class*=flex-item] {
0150 width: 100%;
0151 }
0152 }
0153 .flex-md-hide {
0154 display: none !important;
0155 }
0156 .flex-md-show {
0157 display: flex !important;
0158 }
0159 }
0160
0161 @media (max-width: 768px) {
0162 .flex-sm {
0163 flex-direction: column;
0164 .build-align(row);
0165
0166 [class*=flex-item] {
0167 width: 100%;
0168 }
0169 }
0170 .flex-sm-hide {
0171 display: none !important;
0172 }
0173 .flex-sm-show {
0174 display: flex !important;
0175 }
0176 }
0177
0178
0179