element-ui-costom.scss 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. /*
  2. * element-ui不管是自行构建的主题还是动态设置的主题,
  3. * 产生的css文件中存在近乎1/3的冗余样式,过于累赘,不如直接覆盖样式简洁。
  4. */
  5. // dialog
  6. .el-dialog {
  7. border-radius: 8px;
  8. overflow: hidden;
  9. border: 1px solid #c8c8ca;
  10. box-shadow: 5px 5px 4px 0px rgba(0, 0, 0, 0.1);
  11. &.is-fullscreen {
  12. border-radius: 0;
  13. .el-dialog__header {
  14. width: 100%;
  15. position: fixed;
  16. z-index: 9;
  17. background-color: #fff;
  18. border-bottom: 1px solid $--color-border;
  19. }
  20. .el-dialog__body {
  21. padding-top: 90px;
  22. }
  23. }
  24. }
  25. .el-dialog__header {
  26. padding: 15px 20px;
  27. .el-dialog__title {
  28. color: $--color-text-dark;
  29. font-size: 16px;
  30. line-height: 19px;
  31. }
  32. .el-dialog__headerbtn {
  33. top: 15px;
  34. width: 16px;
  35. height: 16px;
  36. background-image: url(../images/icon-close.png);
  37. background-repeat: no-repeat;
  38. background-size: 100% 100%;
  39. &:hover {
  40. background-image: url(../images/icon-close-act.png);
  41. }
  42. .el-dialog__close {
  43. display: none;
  44. }
  45. }
  46. }
  47. .el-dialog__body {
  48. padding: 30px 40px;
  49. position: relative;
  50. border-top: 1px solid $--color-border;
  51. color: $--color-text-dark-1;
  52. .el-form-item__label {
  53. padding-right: 2px;
  54. }
  55. .el-input-tips {
  56. color: rgba(187, 187, 187, 1);
  57. margin-left: 13px;
  58. }
  59. }
  60. .el-dialog__footer {
  61. overflow: hidden;
  62. .el-button {
  63. width: 100px;
  64. border-radius: 8px;
  65. float: right;
  66. margin-left: 10px;
  67. }
  68. }
  69. // .opacity-dialog
  70. .opacity-dialog {
  71. .el-dialog {
  72. background-color: transparent;
  73. }
  74. .el-dialog__header,
  75. .el-dialog__footer {
  76. display: none;
  77. }
  78. .el-dialog__body {
  79. position: absolute;
  80. width: 100%;
  81. height: 100%;
  82. top: 0;
  83. left: 0;
  84. padding: 0;
  85. background-color: transparent;
  86. }
  87. }
  88. // form
  89. .el-form {
  90. &-item {
  91. &__error {
  92. font-size: 12px;
  93. color: rgba(254, 108, 105, 1);
  94. }
  95. &__content {
  96. .el-table {
  97. line-height: 1;
  98. }
  99. }
  100. }
  101. // form-info
  102. &.form-info {
  103. .el-form-item {
  104. margin-bottom: 0;
  105. .el-form-item__label {
  106. color: $--color-text-gray-2;
  107. }
  108. }
  109. }
  110. &--label-top {
  111. .el-form-item__label {
  112. line-height: 20px;
  113. padding-bottom: 5px;
  114. font-size: 12px;
  115. }
  116. }
  117. }
  118. // input
  119. .el-input {
  120. &.is-focus {
  121. .el-input__inner {
  122. border-color: $--color-primary !important;
  123. }
  124. }
  125. &.is-disabled {
  126. .el-input__inner {
  127. color: $--color-text-gray-2;
  128. }
  129. }
  130. .el-input__inner {
  131. border-radius: 8px;
  132. border-color: #ddd;
  133. background-color: #fff;
  134. }
  135. // .el-input__suffix {
  136. // right: 0;
  137. // border-left: 1px solid #ddd;
  138. // }
  139. }
  140. // textarea
  141. .el-textarea {
  142. &.is-disabled {
  143. .el-textarea__inner {
  144. color: $--color-text-gray-2;
  145. }
  146. }
  147. }
  148. .el-select {
  149. .el-input__suffix {
  150. right: 0;
  151. border-left: 1px solid #ddd;
  152. }
  153. .el-input {
  154. .el-select__caret {
  155. width: 30px;
  156. }
  157. .el-icon-arrow-up:before {
  158. font-size: 12px;
  159. content: "\e78f";
  160. }
  161. }
  162. }
  163. .el-select-dropdown {
  164. &.popper-filter {
  165. .el-scrollbar {
  166. display: block !important;
  167. padding-top: 52px;
  168. }
  169. .el-select-filter {
  170. padding: 0 10px;
  171. position: absolute;
  172. width: 100%;
  173. top: 10px;
  174. left: 0;
  175. z-index: 9;
  176. }
  177. }
  178. }
  179. // upload
  180. .el-upload,
  181. .el-upload-dragger {
  182. width: 100%;
  183. }
  184. // radio
  185. .el-radio-button {
  186. &:hover {
  187. .el-radio-button__inner {
  188. color: $--color-primary;
  189. }
  190. }
  191. }
  192. .el-radio-button__orig-radio:checked + .el-radio-button__inner {
  193. color: $--color-white;
  194. border-color: $--color-primary;
  195. background: $--color-primary;
  196. }
  197. // button
  198. .el-button {
  199. border-radius: $--border-radius;
  200. > .icon {
  201. margin-right: 5px;
  202. }
  203. > span {
  204. display: inline-block;
  205. }
  206. &.is-disabled {
  207. color: $--color-text-gray-3 !important;
  208. background: $--color-background !important;
  209. border: 1px solid $--color-border !important;
  210. }
  211. }
  212. .el-button + .popover-button,
  213. .popover-button + .el-button {
  214. margin-left: 10px;
  215. }
  216. .el-button + .el-button {
  217. margin-left: 10px;
  218. }
  219. .el-button--text + .el-button--text {
  220. margin-left: 5px;
  221. }
  222. .el-button--small {
  223. padding-top: 8px;
  224. padding-bottom: 8px;
  225. font-size: 12px;
  226. }
  227. .el-button--text {
  228. color: $--color-text-gray-2;
  229. & + .el-button--text {
  230. margin-left: 10px;
  231. }
  232. }
  233. .el-button--info {
  234. background-color: $--color-cyan;
  235. border-color: $--color-cyan;
  236. &:hover,
  237. &:focus {
  238. background-color: $--color-cyan-light;
  239. border-color: $--color-cyan-light;
  240. }
  241. }
  242. .el-button--primary {
  243. background-color: $--color-primary;
  244. border-color: $--color-primary;
  245. &:hover,
  246. &:focus {
  247. background-color: $--color-primary-light;
  248. border-color: $--color-primary-light;
  249. }
  250. }
  251. .el-button--success {
  252. background-color: $--color-success;
  253. border-color: $--color-success;
  254. &:hover,
  255. &:focus {
  256. background-color: $--color-success-light;
  257. border-color: $--color-success-light;
  258. }
  259. }
  260. // table
  261. .el-table {
  262. color: $--color-text-dark-1;
  263. thead th {
  264. color: $--color-text-gray-2;
  265. }
  266. thead.is-group th {
  267. background-color: $--color-white;
  268. }
  269. tr.el-table__row {
  270. color: $--color-text-dark;
  271. }
  272. td,
  273. th {
  274. border-color: $--color-border !important;
  275. padding: 14px 0;
  276. font-weight: 500;
  277. }
  278. .el-table__row.row-danger {
  279. color: $--color-danger;
  280. }
  281. &.el-table--noback {
  282. tr.el-table__row {
  283. background-color: $--color-white;
  284. }
  285. }
  286. .cell-head {
  287. display: inline-block;
  288. vertical-align: middle;
  289. line-height: 1.3;
  290. }
  291. // caret-wrapper
  292. .caret-wrapper {
  293. width: 20px;
  294. height: 20px;
  295. top: -1px;
  296. .sort-caret {
  297. &.ascending {
  298. top: -1px;
  299. }
  300. &.descending {
  301. bottom: -1px;
  302. }
  303. }
  304. }
  305. // action-column
  306. td.action-column {
  307. padding-left: 10px;
  308. padding-right: 10px;
  309. .cell {
  310. padding: 0;
  311. margin: 0 -5px;
  312. }
  313. .el-button--text {
  314. padding: 0;
  315. margin: 0 5px;
  316. border: none !important;
  317. outline: none !important;
  318. &:hover {
  319. transform: scale(1.1);
  320. }
  321. }
  322. }
  323. }
  324. .el-table--border {
  325. border-radius: 10px;
  326. th {
  327. padding: 12px 0;
  328. background-color: #fcfcfd;
  329. border-right: none;
  330. }
  331. td {
  332. border-right: none;
  333. }
  334. }
  335. // el-checkbox
  336. .el-checkbox {
  337. .el-checkbox__label {
  338. color: $--color-text-gray-2 !important;
  339. }
  340. .el-checkbox__inner::after {
  341. border-width: 2px;
  342. }
  343. }
  344. .el-checkbox__input.is-checked .el-checkbox__inner {
  345. background-color: $--color-white;
  346. border-color: $--color-primary;
  347. &::after {
  348. border-color: $--color-primary;
  349. }
  350. }
  351. .el-checkbox__input.is-indeterminate .el-checkbox__inner {
  352. background-color: $--color-white;
  353. border-color: $--color-primary;
  354. &::before {
  355. background-color: $--color-primary;
  356. }
  357. }
  358. .el-radio {
  359. .el-radio__label {
  360. color: $--color-text-gray-2 !important;
  361. }
  362. }
  363. .el-radio__input.is-checked .el-radio__inner {
  364. background-color: $--color-white;
  365. border-color: $--color-primary;
  366. &::after {
  367. width: 6px;
  368. height: 6px;
  369. background-color: $--color-primary;
  370. }
  371. }
  372. // el-switch
  373. .el-switch {
  374. &.is-checked {
  375. .el-switch__core {
  376. background-color: $--color-primary;
  377. border-color: $--color-primary;
  378. }
  379. }
  380. }
  381. // el-pagination
  382. .el-pagination-li {
  383. min-width: 32px;
  384. height: 32px;
  385. border-radius: 8px;
  386. overflow: hidden;
  387. background-color: $--color-white;
  388. border: 1px solid #e1e3eb;
  389. }
  390. .el-pagination {
  391. padding: 0;
  392. .el-pagination__total {
  393. float: left;
  394. }
  395. span:not([class*="suffix"]) {
  396. line-height: 32px;
  397. height: 32px;
  398. }
  399. &.is-background {
  400. .btn-prev,
  401. .btn-next {
  402. color: $--color-text-gray-2;
  403. margin: 0 5px;
  404. @extend .el-pagination-li;
  405. }
  406. .btn-prev:disabled,
  407. .btn-next:disabled {
  408. opacity: 0.7;
  409. }
  410. .el-pager li {
  411. color: $--color-text-gray-2;
  412. margin: 0 5px;
  413. padding: 0 8px;
  414. line-height: 32px;
  415. @extend .el-pagination-li;
  416. &:not(.disabled).active {
  417. color: #fff;
  418. background-color: $--color-primary;
  419. }
  420. }
  421. }
  422. }
  423. // el-message-box
  424. .el-message-box {
  425. width: 320px;
  426. background-color: #f6f6f6;
  427. border-radius: 10px;
  428. &__title {
  429. display: none;
  430. }
  431. &__headerbtn {
  432. display: none;
  433. }
  434. &__content {
  435. text-align: center;
  436. .el-message-box__status {
  437. position: relative;
  438. top: 0;
  439. height: 48px;
  440. width: 48px;
  441. transform: none;
  442. margin-bottom: 10px;
  443. &.el-icon-warning {
  444. border-radius: 50%;
  445. &::before {
  446. content: "";
  447. position: absolute;
  448. top: 0;
  449. left: 0;
  450. width: 100%;
  451. height: 100%;
  452. background-image: url(../images/icon-doubt.png);
  453. background-repeat: no-repeat;
  454. background-size: 100% 100%;
  455. }
  456. }
  457. }
  458. .el-message-box__message {
  459. padding: 0;
  460. }
  461. }
  462. &__btns {
  463. height: 75px;
  464. padding: 30px 20px 10px;
  465. text-align: center;
  466. > .el-button {
  467. width: 100px;
  468. }
  469. }
  470. }
  471. .alert-message {
  472. .el-message-box__btns {
  473. text-align: center;
  474. > .el-button {
  475. position: relative;
  476. left: auto;
  477. top: 0;
  478. margin: 0;
  479. }
  480. }
  481. }
  482. // .el-message
  483. .el-message-loading {
  484. border-color: mix($--color-white, $--color-success, 80%);
  485. background-color: mix($--color-white, $--color-success, 90%);
  486. }
  487. // el-date-editor
  488. .el-date-editor {
  489. border-radius: 8px;
  490. .el-range-separator {
  491. width: auto;
  492. }
  493. .el-range-input {
  494. background-color: transparent;
  495. }
  496. }
  497. // el-step
  498. .el-step {
  499. &__title.is-success,
  500. &__description.is-success,
  501. &__title.is-process,
  502. &__description.is-process {
  503. color: $--color-success;
  504. }
  505. &__title.is-process {
  506. font-weight: normal;
  507. }
  508. &__head.is-success {
  509. .el-step__line {
  510. background-color: $--color-success;
  511. }
  512. .el-step__icon.is-text {
  513. color: $--color-white;
  514. border-color: $--color-success;
  515. background-color: $--color-success;
  516. }
  517. }
  518. &__head.is-process {
  519. .el-step__icon.is-text {
  520. color: $--color-success;
  521. border-color: $--color-success;
  522. }
  523. }
  524. &__title.is-wait,
  525. &__description.is-wait {
  526. color: $--color-text-gray-2;
  527. }
  528. &__head.is-wait {
  529. .el-step__icon.is-text {
  530. color: $--color-text-gray-2;
  531. border-color: #e1e3eb;
  532. background-color: #e1e3eb;
  533. }
  534. }
  535. }
  536. // el-popover
  537. .el-popper-dark {
  538. background-color: $--color-text-dark-1;
  539. color: #fff;
  540. font-size: 12px;
  541. line-height: 18px;
  542. padding: 16px;
  543. border: none;
  544. }
  545. .el-popper-dark {
  546. box-shadow: 0px 10px 10px 0px rgba(54, 61, 89, 0.2);
  547. }
  548. .el-popper-dark[x-placement^="right"] .popper__arrow {
  549. border-right-color: $--color-text-dark-1;
  550. &::after {
  551. border-right-color: $--color-text-dark-1;
  552. }
  553. }
  554. .el-popper-dark[x-placement^="top"] .popper__arrow {
  555. border-top-color: $--color-text-dark-1;
  556. &::after {
  557. border-top-color: $--color-text-dark-1;
  558. }
  559. }
  560. .el-popper-dark[x-placement^="bottom"] .popper__arrow {
  561. border-bottom-color: $--color-text-dark-1;
  562. &::after {
  563. border-bottom-color: $--color-text-dark-1;
  564. }
  565. }
  566. .el-popper-dark[x-placement^="left"] .popper__arrow {
  567. border-left-color: $--color-text-dark-1;
  568. &::after {
  569. border-left-color: $--color-text-dark-1;
  570. }
  571. }
  572. // popper-list
  573. .popper-list {
  574. min-width: auto;
  575. .el-button {
  576. display: block;
  577. width: 100%;
  578. margin: 0;
  579. &:not(:last-child) {
  580. margin-bottom: 5px;
  581. }
  582. }
  583. }