material.theme.scss 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. @import 'mixins';
  2. $ng-select-highlight: #3f51b5 !default;
  3. $ng-select-primary-text: rgba(black, 0.87) !default;
  4. $ng-select-primary-light-text: rgba(white, 0.87) !default;
  5. $ng-select-secondary-text: rgba(black, 0.54) !default;
  6. $ng-select-secondary-light-text: rgba(white, 0.54) !default;
  7. $ng-select-disabled-text: rgba(black, 0.38) !default;
  8. $ng-select-divider: rgba(black, 0.12) !default;
  9. $ng-select-bg: #ffffff !default;
  10. .ng-select {
  11. padding-bottom: 1.25em;
  12. &.ng-select-disabled {
  13. .ng-select-container {
  14. &:after {
  15. border-bottom-color: transparent;
  16. background-image: linear-gradient(to right, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0.42) 33%, transparent 0%);
  17. background-size: 4px 1px;
  18. background-repeat: repeat-x;
  19. }
  20. .ng-value-container {
  21. .ng-value {
  22. color: $ng-select-disabled-text;
  23. }
  24. .ng-placeholder {
  25. color: $ng-select-disabled-text;
  26. }
  27. }
  28. }
  29. .ng-arrow-wrapper .ng-arrow,
  30. .ng-clear-wrapper {
  31. color: $ng-select-disabled-text;
  32. }
  33. }
  34. &.ng-select-focused {
  35. .ng-select-container {
  36. &:after {
  37. border-color: $ng-select-highlight;
  38. border-width: 2px;
  39. }
  40. &.ng-appearance-outline {
  41. &:after,
  42. &:hover:after {
  43. border-color: $ng-select-highlight;
  44. border-width: 2px;
  45. }
  46. }
  47. .ng-value-container .ng-placeholder {
  48. transform: translateY(-1.28125em) scale(0.75) perspective(100px) translateZ(0.001px);
  49. color: $ng-select-highlight;
  50. }
  51. .ng-arrow-wrapper .ng-arrow {
  52. color: $ng-select-highlight;
  53. }
  54. }
  55. }
  56. .ng-has-value,
  57. &.ng-select-filtered .ng-select-container {
  58. .ng-placeholder {
  59. display: initial;
  60. }
  61. }
  62. .ng-has-value,
  63. &.ng-select-opened {
  64. .ng-placeholder {
  65. transform: translateY(-1.28125em) scale(0.75) perspective(100px) translateZ(0.001px);
  66. }
  67. }
  68. .ng-select-container {
  69. color: $ng-select-primary-text;
  70. align-items: baseline;
  71. min-height: 51.5px;
  72. &:after {
  73. border-bottom: thin solid rgba(0, 0, 0, 0.42);
  74. content: '';
  75. bottom: 0;
  76. left: 0;
  77. right: 0;
  78. position: absolute;
  79. transition: border-color 0.3s cubic-bezier(0.55, 0, 0.55, 0.2);
  80. }
  81. &.ng-appearance-outline {
  82. padding: 0 0.5em;
  83. min-height: 60px;
  84. &:after {
  85. border: solid 1px $ng-select-divider;
  86. border-radius: 5px;
  87. height: calc(100% - 0.5em);
  88. pointer-events: none;
  89. transition: border-color 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  90. }
  91. &:hover:after {
  92. border-color: $ng-select-primary-text;
  93. border-width: 2px;
  94. }
  95. .ng-placeholder {
  96. padding: 0 0.25em;
  97. background-color: $ng-select-bg;
  98. z-index: 1;
  99. }
  100. .ng-value {
  101. padding-left: 0.25em;
  102. }
  103. }
  104. .ng-value-container {
  105. align-items: stretch;
  106. padding: 0.4375em 0;
  107. border-top: 0.84375em solid transparent;
  108. .ng-placeholder {
  109. position: absolute;
  110. color: $ng-select-secondary-text;
  111. transform-origin: left 0;
  112. transition:
  113. transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
  114. color 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
  115. width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  116. @include rtl {
  117. transform-origin: right 0;
  118. }
  119. }
  120. .ng-input {
  121. bottom: 0.4375em;
  122. }
  123. }
  124. }
  125. &.ng-select-single {
  126. .ng-select-container {
  127. &.ng-appearance-outline {
  128. .ng-arrow-wrapper {
  129. bottom: 17px;
  130. }
  131. .ng-clear-wrapper {
  132. bottom: 14px;
  133. }
  134. }
  135. .ng-arrow-wrapper {
  136. align-self: flex-end;
  137. bottom: 9px;
  138. }
  139. .ng-clear-wrapper {
  140. align-self: flex-end;
  141. bottom: 7px;
  142. }
  143. }
  144. }
  145. &.ng-select-multiple {
  146. &.ng-select-disabled {
  147. .ng-select-container .ng-value-container .ng-value {
  148. background-color: $ng-select-divider;
  149. color: rgba(0, 0, 0, 0.26);
  150. }
  151. .ng-appearance-outline {
  152. &:after,
  153. &:hover:after {
  154. background-image: none;
  155. border: dotted 1px $ng-select-divider;
  156. }
  157. }
  158. }
  159. .ng-select-container {
  160. &.ng-appearance-outline {
  161. &.ng-has-value {
  162. .ng-arrow-wrapper,
  163. .ng-clear-wrapper {
  164. border-top: none;
  165. }
  166. }
  167. .ng-arrow-wrapper {
  168. top: 0;
  169. }
  170. .ng-clear-wrapper {
  171. top: 4px;
  172. }
  173. }
  174. .ng-value-container {
  175. .ng-value {
  176. background-color: $ng-select-highlight;
  177. border-radius: 2px;
  178. color: $ng-select-bg;
  179. padding: 2px 5px;
  180. margin: 0 0.4375em 0.4375em 0;
  181. @include rtl {
  182. margin: 0 0 0.4375em 0.4375em;
  183. }
  184. &.ng-value-disabled {
  185. background-color: $ng-select-divider;
  186. color: rgba(0, 0, 0, 0.26);
  187. }
  188. .ng-value-label {
  189. font-size: 14px;
  190. font-weight: 500;
  191. }
  192. .ng-value-icon {
  193. color: $ng-select-secondary-light-text;
  194. padding-right: 5px;
  195. @include rtl {
  196. padding-left: 5px;
  197. padding-right: 0;
  198. }
  199. &:hover {
  200. color: $ng-select-primary-light-text;
  201. }
  202. }
  203. }
  204. .ng-input {
  205. line-height: 1.375em;
  206. }
  207. }
  208. &.ng-has-value {
  209. align-items: center;
  210. .ng-value-container {
  211. padding-bottom: 0;
  212. padding-top: 0.1875em;
  213. }
  214. .ng-clear-wrapper,
  215. .ng-arrow-wrapper {
  216. border-top: 0.84375em solid transparent;
  217. }
  218. }
  219. }
  220. }
  221. .ng-clear-wrapper {
  222. color: $ng-select-secondary-text;
  223. &:hover {
  224. color: $ng-select-primary-text;
  225. }
  226. &:focus {
  227. color: $ng-select-primary-text;
  228. outline: none;
  229. }
  230. }
  231. .ng-arrow-wrapper {
  232. bottom: 2px;
  233. .ng-arrow {
  234. border-left: 5px solid transparent;
  235. border-right: 5px solid transparent;
  236. border-top: 5px solid;
  237. margin: 0 4px;
  238. color: $ng-select-secondary-text;
  239. }
  240. }
  241. .ng-spinner-zone {
  242. top: 3px;
  243. }
  244. }
  245. .ng-dropdown-panel {
  246. background: $ng-select-bg;
  247. left: 0;
  248. &.ng-select-top {
  249. bottom: calc(100% - 0.84375em);
  250. box-shadow:
  251. 0 -5px 5px -3px rgba(0, 0, 0, 0.2),
  252. 0 -8px 10px 1px rgba(0, 0, 0, 0.14),
  253. 0 -3px 14px 2px $ng-select-divider;
  254. }
  255. &.ng-select-right {
  256. left: 100%;
  257. top: calc(0% + 0.84375em);
  258. box-shadow:
  259. 0 -5px 5px -3px rgba(0, 0, 0, 0.2),
  260. 0 -8px 10px 1px rgba(0, 0, 0, 0.14),
  261. 0 -3px 14px 2px $ng-select-divider;
  262. margin-left: 4px;
  263. }
  264. &.ng-select-bottom {
  265. top: calc(100% - 1.25em);
  266. box-shadow:
  267. 0 5px 5px -3px rgba(0, 0, 0, 0.2),
  268. 0 8px 10px 1px rgba(0, 0, 0, 0.14),
  269. 0 3px 14px 2px $ng-select-divider;
  270. }
  271. &.ng-select-left {
  272. left: calc(-100% - 4px);
  273. top: calc(0% + 0.84375em);
  274. box-shadow:
  275. 0 -5px 5px -3px rgba(0, 0, 0, 0.2),
  276. 0 -8px 10px 1px rgba(0, 0, 0, 0.14),
  277. 0 -3px 14px 2px $ng-select-divider;
  278. }
  279. &.multiple {
  280. .ng-option {
  281. &.selected {
  282. background: $ng-select-bg;
  283. }
  284. &.marked {
  285. background: rgba(0, 0, 0, 0.04);
  286. }
  287. }
  288. }
  289. .ng-dropdown-header {
  290. border-bottom: 1px solid $ng-select-divider;
  291. padding: 0 16px;
  292. line-height: 3em;
  293. min-height: 3em;
  294. }
  295. .ng-dropdown-footer {
  296. border-top: 1px solid $ng-select-divider;
  297. padding: 0 16px;
  298. line-height: 3em;
  299. min-height: 3em;
  300. }
  301. .ng-dropdown-panel-items {
  302. .ng-optgroup {
  303. user-select: none;
  304. cursor: pointer;
  305. line-height: 3em;
  306. height: 3em;
  307. padding: 0 16px;
  308. color: $ng-select-secondary-text;
  309. font-weight: 500;
  310. &.ng-option-marked {
  311. background: rgba(0, 0, 0, 0.04);
  312. }
  313. &.ng-option-disabled {
  314. cursor: default;
  315. }
  316. &.ng-option-selected {
  317. background: $ng-select-divider;
  318. color: $ng-select-highlight;
  319. }
  320. }
  321. .ng-option {
  322. line-height: 3em;
  323. min-height: 3em;
  324. white-space: nowrap;
  325. overflow: hidden;
  326. text-overflow: ellipsis;
  327. padding: 0 16px;
  328. text-decoration: none;
  329. position: relative;
  330. color: $ng-select-primary-text;
  331. text-align: left;
  332. @include rtl {
  333. text-align: right;
  334. }
  335. &.ng-option-marked {
  336. background: rgba(0, 0, 0, 0.04);
  337. color: $ng-select-primary-text;
  338. }
  339. &.ng-option-selected {
  340. background: $ng-select-divider;
  341. color: $ng-select-highlight;
  342. }
  343. &.ng-option-disabled {
  344. color: $ng-select-disabled-text;
  345. }
  346. &.ng-option-child {
  347. padding-left: 32px;
  348. @include rtl {
  349. padding-right: 32px;
  350. padding-left: 0;
  351. }
  352. }
  353. .ng-tag-label {
  354. padding-right: 5px;
  355. @include rtl {
  356. padding-left: 5px;
  357. padding-right: 0;
  358. }
  359. font-size: 80%;
  360. font-weight: 400;
  361. color: $ng-select-disabled-text;
  362. }
  363. }
  364. }
  365. }