mixin.less 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  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-right: 1px solid @m-black9;
  213. border-bottom: 1px solid @m-black9;
  214. white-space: nowrap;
  215. text-overflow: ellipsis;
  216. overflow: hidden;
  217. }
  218. }
  219. }
  220. .ant-table-tbody {
  221. tr {
  222. td {
  223. height: 34px;
  224. line-height: 34px;
  225. padding: 0 8px;
  226. border-right: 1px solid @m-black9;
  227. border-bottom: 1px solid @m-black9;
  228. font-size: 16px;
  229. color: @m-white1;
  230. white-space: nowrap;
  231. text-overflow: ellipsis;
  232. overflow: hidden;
  233. }
  234. }
  235. }
  236. .ant-table-placeholder {
  237. border: 0;
  238. background: @m-black2;
  239. }
  240. }
  241. }
  242. // 弹窗表格
  243. .dialogTable {
  244. .ant-table {
  245. width: 100%;
  246. table {
  247. border: 1px solid @m-grey20;
  248. border-radius: 0;
  249. }
  250. .ant-table-thead {
  251. tr {
  252. box-shadow: 0px 1px 0px 0px #2E3539;
  253. th {
  254. line-height: 36px;
  255. background: @m-grey11;
  256. padding-top: 0;
  257. padding-bottom: 0;
  258. color: @m-grey2;
  259. font-size: 16px;
  260. border-right: 1px solid @m-grey20;
  261. border-bottom: 1px solid @m-grey20;
  262. white-space: nowrap;
  263. text-overflow: ellipsis;
  264. overflow: hidden;
  265. }
  266. }
  267. }
  268. .ant-table-tbody {
  269. tr {
  270. td {
  271. height: 36px;
  272. line-height: 36px;
  273. padding: 0 8px;
  274. border-right: 1px solid @m-grey20;
  275. border-bottom: 1px solid @m-grey20;
  276. font-size: 14px;
  277. color: @m-white1;
  278. white-space: nowrap;
  279. text-overflow: ellipsis;
  280. overflow: hidden;
  281. background: @m-grey11;
  282. }
  283. }
  284. }
  285. .ant-table-placeholder {
  286. border: 0;
  287. background: @m-grey11;
  288. }
  289. }
  290. }
  291. .ant-empty-normal {
  292. color: @m-grey17;
  293. }
  294. .ant-empty-img-simple-path,.ant-empty-img-simple-ellipse {
  295. fill: @m-grey17;
  296. }
  297. .ant-empty-img-simple-g {
  298. stroke: @m-grey17;
  299. }
  300. .add-custom,.commonModal {
  301. .ant-modal-content {
  302. background: #0F1A25;
  303. border-radius: 5px;
  304. .ant-modal-close {
  305. .ant-modal-close-x {
  306. width: 40px;
  307. height: 40px;
  308. line-height: 40px;
  309. .ant-modal-close-icon {
  310. color: #1271BA;
  311. }
  312. }
  313. }
  314. .ant-modal-header {
  315. height: 40px;
  316. background: linear-gradient(0deg, #112C43, #084258);
  317. border-radius: 5px;
  318. padding: 0;
  319. text-align: center;
  320. border-bottom: 0;
  321. .ant-modal-title {
  322. line-height: 40px;
  323. font-size: 16px;
  324. color: @m-white0;
  325. }
  326. }
  327. .ant-modal-body {
  328. min-height: 380px;
  329. }
  330. .ant-modal-footer {
  331. border-top: 0;
  332. text-align: center;
  333. padding-bottom: 31px;
  334. .ant-btn-primary {
  335. width: 200px;
  336. height: 34px;
  337. line-height: 34px;
  338. border: 0;
  339. background: linear-gradient(0deg, @m-blue8 0%, @m-blue9 100%);
  340. border-radius: 3px;
  341. font-size: 16px;
  342. color: @m-white0;
  343. &:hover {
  344. background: linear-gradient(0deg, @m-blue8-hover 0%, @m-blue9-hover 100%);
  345. color: @m-white0-hover;
  346. }
  347. }
  348. .ant-btn.cancelBtn {
  349. width: 200px;
  350. height: 34px;
  351. line-height: 34px;
  352. border: 1px solid @m-blue10;
  353. border-radius: 3px;
  354. background: transparent;
  355. font-size: 16px;
  356. color: @m-blue10;
  357. margin-right: 20px;
  358. &:hover {
  359. border-color: rgba(@m-blue10, .8);
  360. }
  361. }
  362. }
  363. }
  364. }
  365. .ant-form.inlineForm {
  366. .ant-row.ant-form-item {
  367. margin-bottom: 21px;
  368. .ant-form-item-label {
  369. width: 130px;
  370. line-height: 30px;
  371. text-align: left;
  372. label {
  373. color: @m-grey1;
  374. &::after {
  375. content: ''
  376. }
  377. }
  378. }
  379. .ant-form-item-control-wrapper {
  380. .ant-form-item-control {
  381. line-height: 30px;
  382. }
  383. }
  384. }
  385. .relative.ant-form-item {
  386. position: relative;
  387. .tip {
  388. position: absolute;
  389. font-size: 14px;
  390. color: @m-grey1;
  391. }
  392. }
  393. .tc.ant-form-item {
  394. .ant-form-item-control-wrapper {
  395. margin: 0 auto;
  396. }
  397. }
  398. }
  399. .ant-select-single {
  400. .ant-select-selector {
  401. height: 30px;
  402. padding: 0 8px;
  403. background: #15202B;
  404. border: 1px solid #0C95FF;
  405. border-radius: 3px;
  406. color: #E5E5E5;
  407. }
  408. .ant-select-arrow {
  409. right: 8px;
  410. color: #3A87F7;
  411. }
  412. }
  413. .inlineFormSelect.ant-select-single {
  414. .rounded-corners(3px);
  415. border: 1px solid #2B3F52;
  416. &:hover, &:focus {
  417. border-color:#0C95FF;
  418. }
  419. .ant-select-selector {
  420. height: 30px;
  421. padding: 0 8px;
  422. background: #15202B;
  423. border: 0;
  424. color: #E5E5E5;
  425. .ant-select-selection-placeholder {
  426. color: @m-grey10;
  427. }
  428. }
  429. .ant-select-arrow {
  430. right: 8px;
  431. color: #3A87F7 !important;
  432. }
  433. }
  434. .shortSelect.ant-select-single:extend(.inlineFormSelect.ant-select-single) {
  435. margin-right: 0;
  436. .ant-select-selector {
  437. padding: 0 5px;
  438. .ant-select-selection-item {
  439. padding-right: 14px;
  440. }
  441. }
  442. }
  443. .typeSelect.ant-select-single:extend(.inlineFormSelect.ant-select-single) {
  444. .ant-select-selector {
  445. .ant-select-selection-placeholder {
  446. color: @m-grey10;
  447. }
  448. }
  449. .ant-select-arrow {
  450. color: @m-blue0;
  451. }
  452. }
  453. .dialogInput {
  454. background: #15202B;
  455. border: 1px solid @m-grey14;
  456. border-radius: 3px;
  457. color: #E5E5E5;
  458. .ant-input {
  459. color: #E5E5E5;
  460. background: transparent
  461. }
  462. .ant-input-suffix {
  463. color: #E5E5E5;
  464. }
  465. &:hover,&:focus {
  466. border-color: @m-blue10;
  467. }
  468. }