ant.design.theme.scss 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. @import 'mixins';
  2. $ng-select-highlight: #40a9ff !default;
  3. $ng-select-primary-text: rgba(0, 0, 0, 0.65) !default;
  4. $ng-select-disabled-text: rgba(0, 0, 0, 0.25) !default;
  5. $ng-select-disabled-bg: #f5f5f5 !default;
  6. $ng-select-border: #d9d9d9 !default;
  7. $ng-select-bg: #ffffff !default;
  8. $ng-select-selected: rgba(24, 144, 255, 0.2) !default;
  9. $ng-select-marked: #e6f7ff !default;
  10. .ng-select {
  11. position: relative;
  12. &.ng-select-opened {
  13. &.ng-select-clearable .ng-select-container.ng-has-value:hover {
  14. .ng-clear-wrapper {
  15. opacity: 0;
  16. pointer-events: none;
  17. }
  18. .ng-arrow-wrapper {
  19. opacity: 1;
  20. pointer-events: auto;
  21. }
  22. }
  23. > .ng-select-container {
  24. background: $ng-select-bg;
  25. border-color: $ng-select-highlight;
  26. box-shadow: 0 0 0 2px $ng-select-selected;
  27. .ng-arrow-wrapper {
  28. transform: rotate(180deg);
  29. opacity: 1;
  30. @include rtl {
  31. transform: rotate(-180deg);
  32. }
  33. }
  34. }
  35. }
  36. &.ng-select-focused {
  37. .ng-select-container {
  38. border-color: $ng-select-highlight;
  39. }
  40. }
  41. &.ng-select-disabled {
  42. > .ng-select-container {
  43. background-color: $ng-select-disabled-bg;
  44. &:hover {
  45. border: 1px solid $ng-select-border;
  46. cursor: not-allowed;
  47. }
  48. .ng-value-container {
  49. .ng-value {
  50. color: $ng-select-disabled-text;
  51. }
  52. }
  53. }
  54. }
  55. .ng-has-value .ng-placeholder {
  56. display: none;
  57. }
  58. &.ng-select-clearable .ng-select-container.ng-has-value:hover {
  59. .ng-clear-wrapper {
  60. opacity: 1;
  61. }
  62. .ng-arrow-wrapper {
  63. opacity: 0;
  64. pointer-events: none;
  65. }
  66. }
  67. .ng-select-container {
  68. color: $ng-select-primary-text;
  69. background-color: $ng-select-bg;
  70. border-radius: 4px;
  71. border: 1px solid $ng-select-border;
  72. min-height: 30px;
  73. align-items: center;
  74. transition: all 0.3s;
  75. box-sizing: border-box;
  76. padding-right: 11px;
  77. padding-left: 11px;
  78. .ng-input {
  79. line-height: 22px;
  80. input {
  81. color: $ng-select-primary-text;
  82. }
  83. }
  84. .ng-value-container {
  85. align-items: center;
  86. .ng-value {
  87. font-size: 14px;
  88. color: $ng-select-primary-text;
  89. }
  90. .ng-placeholder {
  91. font-size: 14px;
  92. color: lighten($ng-select-primary-text, 60);
  93. }
  94. }
  95. }
  96. &.ng-select-single {
  97. &.ng-select-opened .ng-select-container .ng-value {
  98. opacity: 0.4;
  99. }
  100. .ng-select-container {
  101. .ng-value-container {
  102. .ng-input {
  103. top: 2px;
  104. left: 0;
  105. padding-left: 10px;
  106. padding-right: 50px;
  107. @include rtl {
  108. padding-right: 10px;
  109. padding-left: 50px;
  110. }
  111. }
  112. }
  113. }
  114. }
  115. &.ng-select-multiple {
  116. &.ng-select-disabled {
  117. > .ng-select-container .ng-value-container .ng-value {
  118. background-color: $ng-select-disabled-bg;
  119. .ng-value-label {
  120. padding: 0 5px;
  121. }
  122. }
  123. }
  124. .ng-select-container {
  125. min-height: 32px;
  126. padding-left: 5px;
  127. @include rtl {
  128. padding-right: 5px;
  129. padding-left: 11px;
  130. .ng-value-container .ng-placeholder {
  131. margin-left: 0;
  132. margin-right: 6px;
  133. }
  134. }
  135. .ng-value-container {
  136. padding-bottom: 3px;
  137. .ng-value {
  138. margin-top: 3px;
  139. margin-right: 4px;
  140. font-size: 0.9em;
  141. background-color: #fafafa;
  142. border: 1px solid lighten($ng-select-border, 6);
  143. border-radius: 2px;
  144. height: 24px;
  145. line-height: 22px;
  146. @include rtl {
  147. margin-right: 0;
  148. margin-left: 4px;
  149. }
  150. &.ng-value-disabled {
  151. background-color: $ng-select-disabled-bg;
  152. color: $ng-select-disabled-text;
  153. .ng-value-label {
  154. padding-left: 5px;
  155. @include rtl {
  156. padding-left: 0;
  157. padding-right: 5px;
  158. }
  159. }
  160. }
  161. .ng-value-label {
  162. display: inline-block;
  163. padding: 0 5px;
  164. }
  165. .ng-value-icon {
  166. display: inline-block;
  167. padding: 0 5px;
  168. }
  169. }
  170. .ng-placeholder {
  171. top: 50%;
  172. height: 20px;
  173. margin-top: -10px;
  174. margin-left: 6px;
  175. }
  176. .ng-input {
  177. height: 24px;
  178. margin-top: 3px;
  179. }
  180. }
  181. }
  182. }
  183. .ng-clear-wrapper {
  184. opacity: 0;
  185. color: darken($ng-select-border, 20);
  186. background: rgba(0, 0, 0, 0.25);
  187. width: 12px;
  188. height: 12px;
  189. text-align: center;
  190. border-radius: 12px;
  191. vertical-align: middle;
  192. transition: color 0.3s ease;
  193. position: absolute;
  194. right: 13px;
  195. @include rtl {
  196. left: 13px;
  197. right: auto;
  198. }
  199. &:hover {
  200. background: rgba(0, 0, 0, 0.45);
  201. }
  202. &:focus {
  203. background: rgba(0, 0, 0, 0.45);
  204. outline: none;
  205. }
  206. .ng-clear {
  207. color: #fff;
  208. font-size: 9px;
  209. position: absolute;
  210. left: 3px;
  211. line-height: 12px;
  212. }
  213. }
  214. .ng-spinner-zone {
  215. padding: 5px 5px 0 0;
  216. @include rtl {
  217. padding: 5px 0 0 5px;
  218. }
  219. }
  220. .ng-arrow-wrapper {
  221. width: 16px;
  222. height: 26px;
  223. transition: transform 0.3s;
  224. .ng-arrow {
  225. border-style: solid;
  226. border-width: 0.1rem 0.1rem 0 0;
  227. height: 8px;
  228. width: 8px;
  229. top: -2px;
  230. transform: rotate(135deg);
  231. color: $ng-select-disabled-text;
  232. }
  233. }
  234. }
  235. .ng-dropdown-panel {
  236. background-color: $ng-select-bg;
  237. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  238. border-radius: 4px;
  239. margin-top: 4px;
  240. margin-bottom: 4px;
  241. left: 0;
  242. &.ng-select-top {
  243. bottom: 100%;
  244. border-bottom-color: lighten($ng-select-border, 10);
  245. }
  246. &.ng-select-right {
  247. left: 100%;
  248. top: 0;
  249. border-bottom-color: lighten($ng-select-border, 10);
  250. margin-top: 0;
  251. margin-left: 4px;
  252. }
  253. &.ng-select-bottom {
  254. top: 100%;
  255. border-top-color: lighten($ng-select-border, 10);
  256. }
  257. &.ng-select-left {
  258. left: calc(-100% - 4px);
  259. top: 0;
  260. border-bottom-color: lighten($ng-select-border, 10);
  261. margin-top: 0;
  262. }
  263. .ng-dropdown-header {
  264. border-bottom: 1px solid $ng-select-border;
  265. padding: 5px 7px;
  266. }
  267. .ng-dropdown-footer {
  268. border-top: 1px solid $ng-select-border;
  269. padding: 5px 7px;
  270. }
  271. .ng-dropdown-panel-items {
  272. .ng-optgroup {
  273. user-select: none;
  274. padding: 4px 12px;
  275. color: rgba(0, 0, 0, 0.45);
  276. cursor: pointer;
  277. &.ng-option-disabled {
  278. cursor: default;
  279. color: rgba(0, 0, 0, 0.45);
  280. }
  281. &.ng-option-marked {
  282. background-color: $ng-select-marked;
  283. }
  284. &.ng-option-selected {
  285. background-color: #fafafa;
  286. font-weight: 600;
  287. }
  288. &.ng-option-selected.ng-option-marked {
  289. background-color: $ng-select-marked;
  290. }
  291. }
  292. .ng-option {
  293. background-color: $ng-select-bg;
  294. color: $ng-select-primary-text;
  295. padding: 5px 12px;
  296. transition: background 0.3s ease;
  297. &:first-child {
  298. border-top-right-radius: 4px;
  299. border-top-left-radius: 4px;
  300. }
  301. &:last-child {
  302. border-bottom-right-radius: 4px;
  303. border-bottom-left-radius: 4px;
  304. }
  305. &.ng-option-selected {
  306. background-color: #fafafa;
  307. font-weight: 600;
  308. }
  309. &.ng-option-selected.ng-option-marked {
  310. color: $ng-select-primary-text;
  311. background-color: $ng-select-marked;
  312. }
  313. &.ng-option-marked {
  314. background-color: $ng-select-marked;
  315. color: $ng-select-primary-text;
  316. }
  317. &.ng-option-disabled {
  318. color: $ng-select-disabled-text;
  319. cursor: not-allowed;
  320. }
  321. &.ng-option-child {
  322. padding-left: 20px;
  323. @include rtl {
  324. padding-right: 20px;
  325. padding-left: 0;
  326. }
  327. }
  328. .ng-option-label {
  329. font-size: 14px;
  330. }
  331. .ng-tag-label {
  332. font-size: 80%;
  333. font-weight: 400;
  334. padding-right: 5px;
  335. @include rtl {
  336. padding-left: 5px;
  337. padding-right: 0;
  338. }
  339. }
  340. }
  341. }
  342. @include rtl {
  343. direction: rtl;
  344. text-align: right;
  345. }
  346. }