global.less 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761
  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% - 256px);
  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% - 256px);
  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. }
  428. .ant-dropdown-menu-item > .anticon:first-child,
  429. .ant-dropdown-menu-item > a > .anticon:first-child,
  430. .ant-dropdown-menu-submenu-title > .anticon:first-child .ant-dropdown-menu-submenu-title > a > .anticon:first-child {
  431. min-width: 12px;
  432. margin-right: 8px;
  433. }
  434. }
  435. // 数据列表 样式
  436. .table-alert {
  437. margin-bottom: 16px;
  438. }
  439. .table-page-search-wrapper {
  440. .ant-form-inline {
  441. .ant-form-item {
  442. display: flex;
  443. margin-bottom: 24px;
  444. margin-right: 0;
  445. .ant-form-item-control-wrapper {
  446. flex: 1 1;
  447. display: inline-block;
  448. vertical-align: middle;
  449. }
  450. > .ant-form-item-label {
  451. line-height: 32px;
  452. padding-right: 8px;
  453. width: auto;
  454. }
  455. .ant-form-item-control {
  456. height: 32px;
  457. line-height: 32px;
  458. }
  459. }
  460. }
  461. .table-page-search-submitButtons {
  462. display: block;
  463. margin-bottom: 24px;
  464. white-space: nowrap;
  465. }
  466. }
  467. .content {
  468. .table-operator {
  469. padding: 15px 0;
  470. border-top: 1px solid #eee;
  471. button {
  472. margin-right: 8px;
  473. }
  474. }
  475. .table-operator-nobor{
  476. padding: 0 0 15px 0;
  477. button {
  478. margin-right: 8px;
  479. }
  480. }
  481. }
  482. /* 扩展ant design pro按钮组件颜色 */
  483. .ant-btn-primary.button-primary {
  484. background-color: #39f;
  485. border-color: #39f;
  486. margin: 0 5px;
  487. font-size: 12px;
  488. &:hover, &:focus {
  489. background-color: #52a6fb;
  490. border-color: #52a6fb;
  491. }
  492. &:active, &.active {
  493. background-color: #3d80bf;
  494. border-color: #3d80bf;
  495. }
  496. }
  497. .ant-btn-primary.button-info {
  498. background-color: #2db7f5;
  499. border-color: #2db7f5;
  500. margin: 0 5px;
  501. font-size: 12px;
  502. &:hover, &:focus {
  503. background-color: #32c8f5;
  504. border-color: #32c8f5;
  505. }
  506. &:active, &.active {
  507. background-color: #27a3d8;
  508. border-color: #27a3d8;
  509. }
  510. }
  511. .ant-btn-primary.button-success {
  512. background-color: #0c6;
  513. border-color: #0c6;
  514. margin: 0 5px;
  515. font-size: 12px;
  516. &:hover, &:focus {
  517. background-color: #01dc8c;
  518. border-color: #01dc8c;
  519. }
  520. &:active, &.active {
  521. background-color: #00af57;
  522. border-color: #00af57;
  523. }
  524. }
  525. .ant-btn-primary.button-warning {
  526. background-color: #f90;
  527. border-color: #f90;
  528. margin: 0 5px;
  529. font-size: 12px;
  530. &:hover, &:focus {
  531. background-color: #ffb60a;
  532. border-color: #ffb60a;
  533. }
  534. &:active, &.active {
  535. background-color: #dd8500;
  536. border-color: #dd8500;
  537. }
  538. }
  539. .ant-btn-primary.button-error {
  540. background-color: #f30;
  541. border-color: #f30;
  542. margin: 0 5px;
  543. font-size: 12px;
  544. &:hover, &:focus {
  545. background-color: #ff6666;
  546. border-color: #ff6666;
  547. }
  548. &:active, &.active {
  549. background-color: #d62a00;
  550. border-color: #d62a00;
  551. }
  552. }
  553. .ant-btn-primary.button-geekblue {
  554. background-color: #2F54EB;
  555. border-color: #2F54EB;
  556. margin: 0 5px;
  557. font-size: 12px;
  558. &:hover, &:focus {
  559. background-color: #1d39c4;
  560. border-color: #1d39c4;
  561. }
  562. &:active, &.active {
  563. background-color: #597ef7;
  564. border-color: #597ef7;
  565. }
  566. }
  567. .ant-btn-primary.button-purple {
  568. background-color: #722ED1;
  569. border-color: #722ED1;
  570. margin: 0 5px;
  571. font-size: 12px;
  572. &:hover, &:focus {
  573. background-color: #9254de;
  574. border-color: #9254de;
  575. }
  576. &:active, &.active {
  577. background-color: #531dab;
  578. border-color: #531dab;
  579. }
  580. }
  581. .ant-btn-primary.button-grey {
  582. background-color: #82848a;
  583. border-color: #82848a;
  584. margin: 0 5px;
  585. font-size: 12px;
  586. &:hover, &:focus {
  587. background-color: #909399;
  588. border-color: #909399;
  589. }
  590. &:active, &.active {
  591. background-color: #c8c9cc;
  592. border-color: #c8c9cc;
  593. }
  594. }
  595. // btn-link
  596. .ant-btn-link.button-primary {
  597. color: #39f;
  598. &:hover, &:focus {
  599. color: #52a6fb;
  600. }
  601. &:active, &.active {
  602. color: #3d80bf;
  603. }
  604. }
  605. .ant-btn-link.button-info {
  606. color: #2db7f5;
  607. &:hover, &:focus {
  608. color: #32c8f5;
  609. }
  610. &:active, &.active {
  611. color: #27a3d8;
  612. }
  613. }
  614. .ant-btn-link.button-success {
  615. color: #0c6;
  616. &:hover, &:focus {
  617. color: #01dc8c;
  618. }
  619. &:active, &.active {
  620. color: #00af57;
  621. }
  622. }
  623. .ant-btn-link.button-warning {
  624. color: #e89105;
  625. &:hover, &:focus {
  626. color: #ffb60a;
  627. }
  628. &:active, &.active {
  629. color: #dd8500;
  630. }
  631. }
  632. .ant-btn-link.button-error {
  633. color: #f30;
  634. &:hover, &:focus {
  635. color: #ff6666;
  636. }
  637. &:active, &.active {
  638. color: #d62a00;
  639. }
  640. }
  641. .ant-btn-link.button-geekblue {
  642. color: #2F54EB;
  643. &:hover, &:focus {
  644. color: #1d39c4;
  645. }
  646. &:active, &.active {
  647. color: #597ef7;
  648. }
  649. }
  650. .ant-btn-link.button-purple {
  651. color: #722ED1;
  652. &:hover, &:focus {
  653. color: #9254de;
  654. }
  655. &:active, &.active {
  656. color: #531dab;
  657. }
  658. }
  659. .ant-btn-link.button-grey {
  660. color: #82848a;
  661. &:hover, &:focus {
  662. color: #909399;
  663. }
  664. &:active, &.active {
  665. color: #c8c9cc;
  666. }
  667. }