global.less 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762
  1. @import './index.less';
  2. body {
  3. &.colorWeak {
  4. filter: invert(80%);
  5. }
  6. &.userLayout {
  7. overflow: auto;
  8. }
  9. }
  10. .layout.ant-layout {
  11. height: auto;
  12. overflow-x: hidden;
  13. &.mobile,
  14. &.tablet {
  15. .ant-layout-content {
  16. .content {
  17. margin: 12px 0 0;
  18. }
  19. }
  20. /**
  21. * ant-table-wrapper
  22. * 覆盖的表格手机模式样式,如果想修改在手机上表格最低宽度,可以在这里改动
  23. */
  24. .ant-table-wrapper {
  25. .ant-table-content {
  26. overflow-y: auto;
  27. }
  28. .ant-table-body {
  29. min-width: 800px;
  30. }
  31. }
  32. .topmenu {
  33. /* 必须为 topmenu 才能启用流式布局 */
  34. &.content-width-Fluid {
  35. .header-index-wide {
  36. margin-left: 0;
  37. }
  38. }
  39. }
  40. }
  41. &.mobile {
  42. .sidemenu {
  43. .ant-header-fixedHeader {
  44. &.ant-header-side-opened,
  45. &.ant-header-side-closed {
  46. width: 100%;
  47. }
  48. }
  49. }
  50. }
  51. &.ant-layout-has-sider {
  52. flex-direction: row;
  53. }
  54. .trigger {
  55. font-size: 20px;
  56. line-height: 44px;
  57. padding: 0 24px;
  58. cursor: pointer;
  59. transition: color 0.3s;
  60. &:hover {
  61. background: rgba(0, 0, 0, 0.025);
  62. }
  63. }
  64. .topmenu {
  65. .ant-header-fixedHeader {
  66. position: fixed;
  67. top: 0;
  68. right: 0;
  69. z-index: 9;
  70. width: 100%;
  71. transition: width 0.2s;
  72. &.ant-header-side-opened {
  73. width: 100%;
  74. }
  75. &.ant-header-side-closed {
  76. width: 100%;
  77. }
  78. }
  79. .ant-header-multiTab{
  80. margin: auto;
  81. }
  82. .ant-header-fixedMultiTab{
  83. position: fixed;
  84. z-index: 8;
  85. width: 100%;
  86. top: 44px;
  87. right:0;
  88. margin: auto;
  89. }
  90. /* 必须为 topmenu 才能启用流式布局 */
  91. &.content-width-Fluid {
  92. .header-index-wide {
  93. max-width: unset;
  94. .header-index-left {
  95. flex: 1 1 1000px;
  96. .logo{
  97. margin:0 25px;
  98. }
  99. .ant-menu.ant-menu-horizontal{
  100. max-width: calc(100vw - 190px - 238px - 25px);
  101. flex: 1 1 calc(100vw - 190px - 238px - 25px);
  102. }
  103. }
  104. .header-index-right{
  105. margin-right:25px;
  106. }
  107. }
  108. .page-header-index-wide {
  109. max-width: unset;
  110. }
  111. }
  112. }
  113. .sidemenu {
  114. .ant-header-fixedHeader {
  115. position: fixed;
  116. top: 0;
  117. right: 0;
  118. z-index: 9;
  119. width: 100%;
  120. transition: width 0.2s;
  121. &.ant-header-side-opened {
  122. width: calc(100% - 230px);
  123. }
  124. &.ant-header-side-closed {
  125. width: calc(100% - 80px);
  126. }
  127. }
  128. .ant-header-multiTab{
  129. margin: auto;
  130. }
  131. .ant-header-fixedMultiTab{
  132. position: fixed;
  133. z-index: 8;
  134. width: 100%;
  135. top: 44px;
  136. right:0;
  137. margin: auto;
  138. &.ant-header-side-opened {
  139. width: calc(100% - 230px);
  140. }
  141. &.ant-header-side-closed {
  142. width: calc(100% - 80px);
  143. }
  144. }
  145. }
  146. .header {
  147. height: 44px;
  148. padding: 0 12px 0 0;
  149. background: #fff;
  150. box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
  151. position: relative;
  152. }
  153. .ant-layout-header{
  154. height: 44px;
  155. line-height: 44px;
  156. }
  157. .header,
  158. .top-nav-header-index {
  159. .user-wrapper {
  160. float: right;
  161. height: 100%;
  162. .action {
  163. cursor: pointer;
  164. padding: 0 12px;
  165. display: inline-block;
  166. transition: all 0.3s;
  167. height: 100%;
  168. color: rgba(0, 0, 0, 0.65);
  169. &:hover {
  170. background: rgba(0, 0, 0, 0.025);
  171. }
  172. .avatar {
  173. margin: 20px 8px 20px 0;
  174. color: #1890ff;
  175. background: hsla(0, 0%, 100%, 0.85);
  176. vertical-align: middle;
  177. }
  178. .icon {
  179. font-size: 16px;
  180. padding: 4px;
  181. }
  182. }
  183. }
  184. &.dark {
  185. .user-wrapper {
  186. .action {
  187. color: rgba(255, 255, 255, 0.85);
  188. a {
  189. color: rgba(255, 255, 255, 0.85);
  190. }
  191. &:hover {
  192. background: rgba(255, 255, 255, 0.16);
  193. }
  194. }
  195. }
  196. }
  197. }
  198. &.mobile,
  199. &.tablet {
  200. .top-nav-header-index {
  201. .header-index-wide {
  202. .header-index-left {
  203. .trigger {
  204. color: rgba(255, 255, 255, 0.85);
  205. padding: 0 12px;
  206. }
  207. .logo.top-nav-header {
  208. flex: 0 0 36px;
  209. text-align: center;
  210. line-height: 38px;
  211. h1 {
  212. display: none;
  213. }
  214. }
  215. }
  216. }
  217. &.light {
  218. .header-index-wide {
  219. .header-index-left {
  220. .trigger {
  221. color: rgba(0, 0, 0, 0.65);
  222. }
  223. }
  224. }
  225. //
  226. }
  227. }
  228. }
  229. &.tablet {
  230. // overflow: hidden; text-overflow:ellipsis; white-space: nowrap;
  231. .top-nav-header-index {
  232. .header-index-wide {
  233. .header-index-left {
  234. .logo > a {
  235. overflow: hidden;
  236. text-overflow: ellipsis;
  237. white-space: nowrap;
  238. }
  239. }
  240. .ant-menu.ant-menu-horizontal {
  241. flex: 1 1 auto;
  242. white-space: normal;
  243. }
  244. }
  245. }
  246. }
  247. .top-nav-header-index {
  248. box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
  249. position: relative;
  250. transition: background 0.3s, width 0.2s;
  251. .header-index-wide {
  252. max-width: 1200px;
  253. margin: auto;
  254. padding-left: 0;
  255. display: flex;
  256. height: 44px;
  257. .ant-menu.ant-menu-horizontal {
  258. max-width: 835px;
  259. flex: 0 1 835px;
  260. border: none;
  261. height: 44px;
  262. line-height: 44px;
  263. }
  264. .header-index-left {
  265. flex: 0 1 1000px;
  266. display: flex;
  267. .logo.top-nav-header {
  268. flex: 0 0 auto;
  269. width: auto;
  270. height: 44px;
  271. position: relative;
  272. line-height: 44px;
  273. transition: all 0.3s;
  274. overflow: hidden;
  275. img,
  276. svg {
  277. display: inline-block;
  278. vertical-align: middle;
  279. height: 42px;
  280. width: 42px;
  281. }
  282. h1 {
  283. color: #fff;
  284. display: inline-block;
  285. vertical-align: top;
  286. font-size: 16px;
  287. margin: 0 0 0 12px;
  288. font-weight: 400;
  289. }
  290. }
  291. }
  292. .header-index-right {
  293. flex: 0 0 238px;
  294. align-self: flex-end;
  295. height: 44px;
  296. overflow: hidden;
  297. .content-box {
  298. float: right;
  299. }
  300. }
  301. }
  302. &.light {
  303. background-color: #fff;
  304. .header-index-wide {
  305. .header-index-left {
  306. .logo {
  307. h1 {
  308. color: #002140;
  309. }
  310. }
  311. }
  312. }
  313. }
  314. }
  315. // 内容区
  316. .layout-content {
  317. margin: 24px 24px 0px;
  318. height: 100%;
  319. height: 64px;
  320. padding: 0 12px 0 0;
  321. }
  322. // footer
  323. .ant-layout-footer {
  324. padding: 0;
  325. }
  326. }
  327. .topmenu {
  328. .page-header-index-wide {
  329. max-width: 1200px;
  330. margin: 0 auto;
  331. }
  332. }
  333. // drawer-sider 自定义
  334. .ant-drawer.drawer-sider {
  335. .sider {
  336. box-shadow: none;
  337. }
  338. &.dark {
  339. .ant-drawer-content {
  340. background-color: rgb(0, 21, 41);
  341. }
  342. }
  343. &.light {
  344. box-shadow: none;
  345. .ant-drawer-content {
  346. background-color: #fff;
  347. }
  348. }
  349. .ant-drawer-body {
  350. padding: 0;
  351. }
  352. }
  353. // 菜单样式
  354. .sider {
  355. box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
  356. position: relative;
  357. z-index: @ant-global-sider-zindex;
  358. min-height: 100vh;
  359. .ant-layout-sider-children {
  360. overflow-y: hidden;
  361. &:hover {
  362. overflow-y: auto;
  363. }
  364. }
  365. &.ant-fixed-sidemenu {
  366. position: fixed;
  367. height: 100%;
  368. }
  369. .logo {
  370. position: relative;
  371. height: 44px;
  372. padding-left: 10px;
  373. overflow: hidden;
  374. line-height: 44px;
  375. background: #002140;
  376. transition: all .3s;
  377. img,
  378. svg,
  379. h1 {
  380. display: inline-block;
  381. vertical-align: middle;
  382. }
  383. img,
  384. svg {
  385. height: 42px;
  386. width: 42px;
  387. }
  388. h1 {
  389. color: #fff;
  390. font-size: 16px;
  391. margin: 0 0 0 6px;
  392. font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
  393. font-weight: 600;
  394. vertical-align: middle;
  395. }
  396. }
  397. &.ant-layout-sider-collapsed{
  398. .logo{
  399. padding-left: 20px;
  400. }
  401. }
  402. &.light {
  403. background-color: #fff;
  404. box-shadow: 2px 0px 8px 0px rgba(29, 35, 41, 0.05);
  405. .logo {
  406. background: #fff;
  407. box-shadow: 1px 1px 0px 0px #e8e8e8;
  408. h1 {
  409. color: unset;
  410. }
  411. }
  412. .ant-menu-light {
  413. border-right-color: transparent;
  414. }
  415. }
  416. }
  417. // 外置的样式控制
  418. .user-dropdown-menu {
  419. span {
  420. user-select: none;
  421. }
  422. }
  423. .user-dropdown-menu-wrapper.ant-dropdown-menu {
  424. padding: 4px 0;
  425. .ant-dropdown-menu-item {
  426. // width: 160px;
  427. width: 100%;
  428. }
  429. .ant-dropdown-menu-item > .anticon:first-child,
  430. .ant-dropdown-menu-item > a > .anticon:first-child,
  431. .ant-dropdown-menu-submenu-title > .anticon:first-child .ant-dropdown-menu-submenu-title > a > .anticon:first-child {
  432. min-width: 12px;
  433. margin-right: 8px;
  434. }
  435. }
  436. // 数据列表 样式
  437. .table-alert {
  438. margin-bottom: 16px;
  439. }
  440. .table-page-search-wrapper {
  441. .ant-form-inline {
  442. .ant-form-item {
  443. display: flex;
  444. margin-bottom: 24px;
  445. margin-right: 0;
  446. .ant-form-item-control-wrapper {
  447. flex: 1 1;
  448. display: inline-block;
  449. vertical-align: middle;
  450. }
  451. > .ant-form-item-label {
  452. line-height: 32px;
  453. padding-right: 8px;
  454. width: auto;
  455. }
  456. .ant-form-item-control {
  457. height: 32px;
  458. line-height: 32px;
  459. }
  460. }
  461. }
  462. .table-page-search-submitButtons {
  463. display: block;
  464. margin-bottom: 24px;
  465. white-space: nowrap;
  466. }
  467. }
  468. .content {
  469. .table-operator {
  470. padding: 15px 0;
  471. border-top: 1px solid #eee;
  472. button {
  473. margin-right: 8px;
  474. }
  475. }
  476. .table-operator-nobor{
  477. padding: 0 0 15px 0;
  478. button {
  479. margin-right: 8px;
  480. }
  481. }
  482. }
  483. /* 扩展ant design pro按钮组件颜色 */
  484. .ant-btn-primary.button-primary {
  485. background-color: #39f;
  486. border-color: #39f;
  487. margin: 0 5px;
  488. font-size: 12px;
  489. &:hover, &:focus {
  490. background-color: #52a6fb;
  491. border-color: #52a6fb;
  492. }
  493. &:active, &.active {
  494. background-color: #3d80bf;
  495. border-color: #3d80bf;
  496. }
  497. }
  498. .ant-btn-primary.button-info {
  499. background-color: #2db7f5;
  500. border-color: #2db7f5;
  501. margin: 0 5px;
  502. font-size: 12px;
  503. &:hover, &:focus {
  504. background-color: #32c8f5;
  505. border-color: #32c8f5;
  506. }
  507. &:active, &.active {
  508. background-color: #27a3d8;
  509. border-color: #27a3d8;
  510. }
  511. }
  512. .ant-btn-primary.button-success {
  513. background-color: #0c6;
  514. border-color: #0c6;
  515. margin: 0 5px;
  516. font-size: 12px;
  517. &:hover, &:focus {
  518. background-color: #01dc8c;
  519. border-color: #01dc8c;
  520. }
  521. &:active, &.active {
  522. background-color: #00af57;
  523. border-color: #00af57;
  524. }
  525. }
  526. .ant-btn-primary.button-warning {
  527. background-color: #f90;
  528. border-color: #f90;
  529. margin: 0 5px;
  530. font-size: 12px;
  531. &:hover, &:focus {
  532. background-color: #ffb60a;
  533. border-color: #ffb60a;
  534. }
  535. &:active, &.active {
  536. background-color: #dd8500;
  537. border-color: #dd8500;
  538. }
  539. }
  540. .ant-btn-primary.button-error {
  541. background-color: #f30;
  542. border-color: #f30;
  543. margin: 0 5px;
  544. font-size: 12px;
  545. &:hover, &:focus {
  546. background-color: #ff6666;
  547. border-color: #ff6666;
  548. }
  549. &:active, &.active {
  550. background-color: #d62a00;
  551. border-color: #d62a00;
  552. }
  553. }
  554. .ant-btn-primary.button-geekblue {
  555. background-color: #2F54EB;
  556. border-color: #2F54EB;
  557. margin: 0 5px;
  558. font-size: 12px;
  559. &:hover, &:focus {
  560. background-color: #1d39c4;
  561. border-color: #1d39c4;
  562. }
  563. &:active, &.active {
  564. background-color: #597ef7;
  565. border-color: #597ef7;
  566. }
  567. }
  568. .ant-btn-primary.button-purple {
  569. background-color: #722ED1;
  570. border-color: #722ED1;
  571. margin: 0 5px;
  572. font-size: 12px;
  573. &:hover, &:focus {
  574. background-color: #9254de;
  575. border-color: #9254de;
  576. }
  577. &:active, &.active {
  578. background-color: #531dab;
  579. border-color: #531dab;
  580. }
  581. }
  582. .ant-btn-primary.button-grey {
  583. background-color: #82848a;
  584. border-color: #82848a;
  585. margin: 0 5px;
  586. font-size: 12px;
  587. &:hover, &:focus {
  588. background-color: #909399;
  589. border-color: #909399;
  590. }
  591. &:active, &.active {
  592. background-color: #c8c9cc;
  593. border-color: #c8c9cc;
  594. }
  595. }
  596. // btn-link
  597. .ant-btn-link.button-primary {
  598. color: #39f;
  599. &:hover, &:focus {
  600. color: #52a6fb;
  601. }
  602. &:active, &.active {
  603. color: #3d80bf;
  604. }
  605. }
  606. .ant-btn-link.button-info {
  607. color: #2db7f5;
  608. &:hover, &:focus {
  609. color: #32c8f5;
  610. }
  611. &:active, &.active {
  612. color: #27a3d8;
  613. }
  614. }
  615. .ant-btn-link.button-success {
  616. color: #0c6;
  617. &:hover, &:focus {
  618. color: #01dc8c;
  619. }
  620. &:active, &.active {
  621. color: #00af57;
  622. }
  623. }
  624. .ant-btn-link.button-warning {
  625. color: #e89105;
  626. &:hover, &:focus {
  627. color: #ffb60a;
  628. }
  629. &:active, &.active {
  630. color: #dd8500;
  631. }
  632. }
  633. .ant-btn-link.button-error {
  634. color: #f30;
  635. &:hover, &:focus {
  636. color: #ff6666;
  637. }
  638. &:active, &.active {
  639. color: #d62a00;
  640. }
  641. }
  642. .ant-btn-link.button-geekblue {
  643. color: #2F54EB;
  644. &:hover, &:focus {
  645. color: #1d39c4;
  646. }
  647. &:active, &.active {
  648. color: #597ef7;
  649. }
  650. }
  651. .ant-btn-link.button-purple {
  652. color: #722ED1;
  653. &:hover, &:focus {
  654. color: #9254de;
  655. }
  656. &:active, &.active {
  657. color: #531dab;
  658. }
  659. }
  660. .ant-btn-link.button-grey {
  661. color: #82848a;
  662. &:hover, &:focus {
  663. color: #909399;
  664. }
  665. &:active, &.active {
  666. color: #c8c9cc;
  667. }
  668. }