mixin.less 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. // 公共的mixin混入(可以把重复的样式封装为mixin 混入到复用的地方)
  2. // .iconBg(@width: 3rem, @height: 3rem, @bgUrl: 'icons.png') {
  3. // /*图片背景,大小作为参数传递,默认是30*30*/
  4. // display: inline-block;
  5. // width: @width;
  6. // height: @height;
  7. // cursor: pointer;
  8. // background-image: url('../images/@{bgUrl}');
  9. // background-color: transparent;
  10. // }
  11. .position(@position: static, @top: auto, @right: auto, @bottom: auto, @left: auto) {
  12. // 定位方式
  13. position: @position;
  14. top: @top;
  15. right: @right;
  16. bottom: @bottom;
  17. left: @left;
  18. }
  19. .boxShadow(@color, @xWdh, @yWdh, @wdh) {
  20. box-shadow: @color @xWdh @yWdh @wdh;
  21. -webkit-box-shadow: @color @xWdh @yWdh @wdh;
  22. -moz-box-shadow: @color @xWdh @yWdh @wdh;
  23. }
  24. .link-colors(@normal: @black-color, @hover-color: @hover-color, @visited: @black-color) {
  25. /*a标签经过以及访问颜色变化混合器*/
  26. color: @normal;
  27. &:hover {
  28. color: @hover-color;
  29. }
  30. &:visited {
  31. color: @visited;
  32. }
  33. }
  34. .rounded-corners(@border-radius: 5px, @border-radius1: @border-radius, @border-radius2: @border-radius, @border-radius3: @border-radius) {
  35. /*圆角兼容性*/
  36. -moz-border-radius: @border-radius @border-radius1 @border-radius2 @border-radius3;
  37. -webkit-border-radius: @border-radius @border-radius1 @border-radius2 @border-radius3;
  38. border-radius: @border-radius @border-radius1 @border-radius2 @border-radius3;
  39. }
  40. // 线性渐变
  41. .linearGradient(@point, @start, @stop) {
  42. background-color: @stop;
  43. background: linear-gradient(@point, @start, @stop);
  44. background: -moz-linear-gradient(@point, @start, @stop);
  45. background: -webkit-linear-gradient(@point, @start, @stop);
  46. }
  47. .transition-animation(@property: all, @duration: 0.2s, @timing-function: linear) {
  48. /*过渡动画*/
  49. transition: @property @duration @timing-function;
  50. -webkit-transition: @property @duration @timing-function;
  51. -moz-transition: @property @duration @timing-function;
  52. }
  53. .borderStyle(@width: 1px, @style: solid, @color: #181d1f) {
  54. border: @width @style @color;
  55. }
  56. .resetElement(@border: 0, @background: transparent, @radius: 0) {
  57. border: @border;
  58. background-color: @background;
  59. border-radius: @radius;
  60. }
  61. /* 定制宽高按钮 */
  62. .btn(@width: @width, @height: @height) {
  63. width: @width;
  64. height: @height;
  65. line-height: @height;
  66. cursor: pointer;
  67. }
  68. // flex弹性布局兼容性
  69. .flex {
  70. display: -webkit-box; /* Chrome 4+, Safari 3.1, iOS Safari 3.2+ */
  71. display: -moz-box; /* Firefox 17- */
  72. display: -webkit-flex; /* Chrome 21+, Safari 6.1+, iOS Safari 7+, Opera 15/16 */
  73. display: -moz-flex; /* Firefox 18+ */
  74. display: -ms-flexbox; /* IE 10 */
  75. display: flex; /* Chrome 29+, Firefox 22+, IE 11+, Opera 12.1/17/18, Android 4.4+ */
  76. }
  77. // 行内flex 弹性布局兼容性
  78. .inlineflex {
  79. display: -webkit-inline-box; /* Chrome 4+, Safari 3.1, iOS Safari 3.2+ */
  80. display: -moz-inline-box; /* Firefox 17- */
  81. display: -webkit-inline-flex; /* Chrome 21+, Safari 6.1+, iOS Safari 7+, Opera 15/16 */
  82. display: -moz-inline-flex; /* Firefox 18+ */
  83. display: -ms-inline-flexbox; /* IE 10 */
  84. display: inline-flex; /* Chrome 29+, Firefox 22+, IE 11+, Opera 12.1/17/18, Android 4.4+ */
  85. }
  86. // 行内元素span强转块元素
  87. .specailSpan(@width: 50%, @height: 2.6rem) {
  88. display: inline-block;
  89. text-align: center;
  90. float: left;
  91. width: @width;
  92. height: @height;
  93. line-height: @height;
  94. cursor: pointer;
  95. }
  96. .inputStyle(@height: 2.8rem, @fontSize: 1.3rem) {
  97. height: @height;
  98. line-height: @height;
  99. border-color: @money-border-color;
  100. color: @black-color;
  101. font-size: @fontSize;
  102. @if @skin == 'black' {
  103. background-color: transparent;
  104. } @else if @skin == 'white' {
  105. background-color: @white-color;
  106. }
  107. }
  108. .ellipse {
  109. // 一行显示,超过显示省略号
  110. white-space: nowrap;
  111. text-overflow: ellipsis;
  112. overflow: hidden;
  113. }
  114. .dateInputStyle(@width: 12rem, @height: 2.2rem, @fontSize: 1.3rem) {
  115. width: @width;
  116. height: @height;
  117. line-height: @height;
  118. @if @skin == 'black' {
  119. background-color: transparent;
  120. } @else if @skin == 'white' {
  121. background-color: @white-color;
  122. }
  123. border-color: @money-border-color;
  124. font-size: @fontSize;
  125. }
  126. .submitBtnStyle(@width: 12rem, @height: 2.8rem, @fontSize: 1.4rem, @rounded: 2px) {
  127. width: @width;
  128. height: @height;
  129. line-height: @height;
  130. padding: 0;
  131. color: @white-color;
  132. background-color: @hover-color;
  133. border-color: @hover-color;
  134. font-size: @fontSize;
  135. .rounded-corners(@rounded);
  136. }
  137. .resetBtnStyle(@width: 7rem, @height: 2.2rem, @fontSize: 1.3rem, @rounded: 2px) {
  138. width: @width;
  139. height: @height;
  140. line-height: @height;
  141. padding: 0;
  142. color: @hover-color;
  143. background-color: transparent;
  144. border-color: @hover-color;
  145. font-size: @fontSize;
  146. .rounded-corners(@rounded);
  147. }
  148. .ant-input {
  149. &::placeholder {
  150. color: @m-grey10;
  151. }
  152. }
  153. .commonInput {
  154. background: #15202B;
  155. border: 1px solid @m-grey14;
  156. border-radius: 3px;
  157. color: #E5E5E5;
  158. .ant-input {
  159. color: #E5E5E5;
  160. background: transparent;
  161. }
  162. .ant-input-suffix {
  163. color: #E5E5E5;
  164. }
  165. &:hover, &:focus {
  166. border-color:#0C95FF;
  167. }
  168. }
  169. .tableConditionInput {
  170. width: 140px;
  171. height: 30px;
  172. line-height: 30px;
  173. background: @m-grey9;
  174. .rounded-corners(3px);
  175. border: 0;
  176. color: @m-white1;
  177. font-size: 14px;
  178. }
  179. .tableConditionInput+.tableConditionInput {
  180. margin-left: 10px;
  181. }
  182. .ant-select-dropdown {
  183. background: #424E59;
  184. border: 1px solid #48545F;
  185. box-shadow: 0px 10px 10px 0px rgba(18, 22, 24, 0.36);
  186. border-radius: 5px;
  187. .ant-select-item {
  188. color:@m-grey1;
  189. }
  190. .ant-select-item-option-active,.ant-select-item-option-selected,.ant-select-item-option-hover {
  191. background: @m-blue0;
  192. color: @m-white1;
  193. }
  194. }
  195. // 上面表格样式
  196. .topTable {
  197. .ant-table {
  198. width: 100%;
  199. table {
  200. border: 0;
  201. }
  202. .ant-table-thead {
  203. tr {
  204. box-shadow: 0px 1px 0px 0px #2E3539;
  205. th {
  206. line-height: 34px;
  207. background: @m-black8;
  208. padding-top: 0;
  209. padding-bottom: 0;
  210. color: @m-grey17;
  211. font-size: 14px;
  212. border-color: @m-black9;
  213. }
  214. }
  215. }
  216. .ant-table-tbody {
  217. tr {
  218. }
  219. }
  220. .ant-table-placeholder {
  221. border: 0;
  222. background: @m-black2;
  223. }
  224. }
  225. }
  226. .ant-empty-normal {
  227. color: @m-grey17;
  228. }
  229. .ant-empty-img-simple-path,.ant-empty-img-simple-ellipse {
  230. fill: @m-grey17;
  231. }
  232. .ant-empty-img-simple-g {
  233. stroke: @m-grey17;
  234. }
  235. .add-custom {
  236. .ant-modal-content {
  237. background: #0F1A25;
  238. border-radius: 5px;
  239. .ant-modal-close {
  240. .ant-modal-close-x {
  241. width: 40px;
  242. height: 40px;
  243. line-height: 40px;
  244. .ant-modal-close-icon {
  245. color: #1271BA;
  246. }
  247. }
  248. }
  249. .ant-modal-header {
  250. height: 40px;
  251. background: linear-gradient(0deg, #112C43, #084258);
  252. border-radius: 5px;
  253. padding: 0;
  254. text-align: center;
  255. border-bottom: 0;
  256. .ant-modal-title {
  257. line-height: 40px;
  258. font-size: 16px;
  259. color: @m-white0;
  260. }
  261. }
  262. .ant-modal-body {
  263. }
  264. .ant-modal-footer {
  265. border-top: 0;
  266. text-align: center;
  267. padding-bottom: 31px;
  268. .ant-btn-primary {
  269. width: 200px;
  270. height: 34px;
  271. line-height: 34px;
  272. border: 0;
  273. background: linear-gradient(0deg, @m-blue8 0%, @m-blue9 100%);
  274. border-radius: 3px;
  275. font-size: 16px;
  276. color: @m-white0;
  277. &:hover {
  278. background: linear-gradient(0deg, @m-blue8-hover 0%, @m-blue9-hover 100%);
  279. color: @m-white0-hover;
  280. }
  281. }
  282. }
  283. }
  284. }
  285. .ant-form.inlineForm {
  286. .ant-row.ant-form-item {
  287. margin-bottom: 21px;
  288. .ant-form-item-label {
  289. width: 130px;
  290. line-height: 30px;
  291. text-align: left;
  292. label {
  293. color: @m-grey1;
  294. &::after {
  295. content: ''
  296. }
  297. }
  298. }
  299. .ant-form-item-control-wrapper {
  300. .ant-form-item-control {
  301. line-height: 30px;
  302. }
  303. }
  304. }
  305. .relative.ant-form-item {
  306. position: relative;
  307. .tip {
  308. position: absolute;
  309. font-size: 14px;
  310. color: @m-grey1;
  311. }
  312. }
  313. .tc.ant-form-item {
  314. .ant-form-item-control-wrapper {
  315. margin: 0 auto;
  316. }
  317. }
  318. }
  319. .ant-select-single {
  320. .ant-select-selector {
  321. height: 30px;
  322. padding: 0 8px;
  323. background: #15202B;
  324. border: 1px solid #0C95FF;
  325. border-radius: 3px;
  326. color: #E5E5E5;
  327. }
  328. .ant-select-arrow {
  329. right: 8px;
  330. color: #3A87F7;
  331. }
  332. }
  333. .inlineFormSelect.ant-select-single {
  334. .rounded-corners(3px);
  335. border: 1px solid #2B3F52;
  336. &:hover, &:focus {
  337. border-color:#0C95FF;
  338. }
  339. .ant-select-selector {
  340. height: 30px;
  341. padding: 0 8px;
  342. background: #15202B;
  343. border: 0;
  344. color: #E5E5E5;
  345. .ant-select-selection-placeholder {
  346. color: @m-grey10;
  347. }
  348. }
  349. .ant-select-arrow {
  350. right: 8px;
  351. color: #3A87F7 !important;
  352. }
  353. }
  354. .shortSelect.ant-select-single:extend(.inlineFormSelect.ant-select-single) {
  355. margin-right: 0;
  356. .ant-select-selector {
  357. padding: 0 5px;
  358. .ant-select-selection-item {
  359. padding-right: 14px;
  360. }
  361. }
  362. }
  363. .typeSelect.ant-select-single:extend(.inlineFormSelect.ant-select-single) {
  364. .ant-select-selector {
  365. .ant-select-selection-placeholder {
  366. color: @m-grey10;
  367. }
  368. }
  369. .ant-select-arrow {
  370. color: @m-blue0;
  371. }
  372. }
  373. .dialogInput {
  374. background: #15202B;
  375. border: 1px solid @m-grey14;
  376. border-radius: 3px;
  377. color: #E5E5E5;
  378. .ant-input {
  379. color: #E5E5E5;
  380. background: transparent
  381. }
  382. .ant-input-suffix {
  383. color: #E5E5E5;
  384. }
  385. }