inputs.scss 24 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004
  1. /**
  2. * @copyright Copyright (c) 2016, John Molakvoæ <skjnldsv@protonmail.com>
  3. * @copyright Copyright (c) 2016, Morris Jobke <hey@morrisjobke.de>
  4. * @copyright Copyright (c) 2016, Joas Schilling <coding@schilljs.com>
  5. * @copyright Copyright (c) 2016, Julius Haertl <jus@bitgrid.net>
  6. * @copyright Copyright (c) 2016, jowi <sjw@gmx.ch>
  7. * @copyright Copyright (c) 2015, Joas Schilling <nickvergessen@owncloud.com>
  8. * @copyright Copyright (c) 2015, Hendrik Leppelsack <hendrik@leppelsack.de>
  9. * @copyright Copyright (c) 2014-2017, Jan-Christoph Borchardt <hey@jancborchardt.net>
  10. *
  11. * @license GNU AGPL version 3 or any later version
  12. *
  13. */
  14. @use 'variables';
  15. @import 'functions';
  16. /* Specifically override browser styles */
  17. input, textarea, select, button, div[contenteditable=true], div[contenteditable=false] {
  18. font-family: var(--font-face);
  19. }
  20. .select2-container-multi .select2-choices .select2-search-field input, .select2-search input, .ui-widget {
  21. font-family: var(--font-face) !important;
  22. }
  23. .select2-container.select2-drop-above .select2-choice {
  24. background-image: unset !important;
  25. }
  26. $default-height: 36px;
  27. /* Simple selector to allow easy overriding */
  28. select,
  29. button:not(.button-vue),
  30. input,
  31. textarea,
  32. div[contenteditable=true],
  33. div[contenteditable=false] {
  34. width: 130px;
  35. min-height: $default-height;
  36. box-sizing: border-box;
  37. }
  38. /**
  39. * color-text-lighter normal state
  40. * color-text-lighter active state
  41. * color-text-maxcontrast disabled state
  42. */
  43. input:not([type="range"]) {
  44. outline: none;
  45. }
  46. /* Default global values */
  47. div.select2-drop .select2-search input, // TODO: REMOVE WHEN DROPPING SELECT2
  48. input[type='submit'],
  49. input[type='button'],
  50. input[type='reset'],
  51. button:not(.button-vue), .button,
  52. .pager li a {
  53. margin: 3px 3px 3px 0;
  54. padding: 7px 14px;
  55. font-size: 13px;
  56. background-color: var(--color-main-background);
  57. color: var(--color-main-text);
  58. border: 1px solid var(--color-border-dark);
  59. font-size: var(--default-font-size);
  60. outline: none;
  61. border-radius: var(--border-radius);
  62. cursor: text;
  63. &:not(:disabled):not(.primary) {
  64. &:hover,
  65. &:focus,
  66. &.active {
  67. /* active class used for multiselect */
  68. border-color: var(--color-primary-element);
  69. outline: none;
  70. }
  71. &:active {
  72. outline: none;
  73. background-color: var(--color-main-background);
  74. color: var(--color-text-light);
  75. }
  76. &:focus-visible {
  77. box-shadow: 0 0 0 2px var(--color-primary);
  78. }
  79. }
  80. &:disabled {
  81. background-color: var(--color-background-dark);
  82. color: var(--color-main-text);
  83. cursor: default;
  84. opacity: 0.5;
  85. }
  86. &:required {
  87. box-shadow: none;
  88. }
  89. &:user-invalid {
  90. box-shadow: 0 0 0 2px var(--color-error) !important;
  91. }
  92. /* Primary action button, use sparingly */
  93. &.primary {
  94. background-color: var(--color-primary-element);
  95. border-color: var(--color-primary-element);
  96. color: var(--color-primary-text);
  97. cursor: pointer;
  98. /* Apply border to primary button if on log in page (and not in a dark container) or if in header */
  99. #body-login :not(.body-login-container) &,
  100. #header & {
  101. border-color: var(--color-primary-text);
  102. }
  103. &:not(:disabled) {
  104. &:hover,
  105. &:focus,
  106. &:active {
  107. background-color: var(--color-primary-element-hover);
  108. border-color: var(--color-primary-element-hover);
  109. }
  110. &:focus,
  111. &:focus-visible {
  112. box-shadow: 0 0 0 2px var(--color-main-text);
  113. }
  114. &:active {
  115. color: var(--color-primary-text-dark);
  116. }
  117. }
  118. &:disabled {
  119. // opacity is already defined to .5 if disabled
  120. background-color: var(--color-primary-element);
  121. color: var(--color-primary-text-dark);
  122. cursor: default;
  123. }
  124. }
  125. }
  126. div[contenteditable=false] {
  127. margin: 3px 3px 3px 0;
  128. padding: 7px 6px;
  129. font-size: 13px;
  130. background-color: var(--color-main-background);
  131. color: var(--color-text-lighter);
  132. border: 1px solid var(--color-background-darker);
  133. outline: none;
  134. border-radius: var(--border-radius);
  135. background-color: var(--color-background-dark);
  136. color: var(--color-text-lighter);
  137. cursor: default;
  138. opacity: 0.5;
  139. }
  140. /* Specific override */
  141. input {
  142. &:not([type='radio']):not([type='checkbox']):not([type='range']):not([type='submit']):not([type='button']):not([type='reset']):not([type='color']):not([type='file']):not([type='image']) {
  143. -webkit-appearance: textfield;
  144. -moz-appearance: textfield;
  145. // force height for inline elements like inputs (not textarea, contenteditable...)
  146. height: $default-height;
  147. }
  148. &[type='radio'],
  149. &[type='checkbox'],
  150. &[type='file'],
  151. &[type='image'] {
  152. height: auto;
  153. width: auto;
  154. }
  155. /* Color input doesn't respect the initial height
  156. so we need to set a custom one */
  157. &[type='color'] {
  158. margin: 3px;
  159. padding: 0 2px;
  160. min-height: 30px;
  161. width: 40px;
  162. cursor: pointer;
  163. }
  164. &[type='hidden'] {
  165. height: 0;
  166. width: 0;
  167. }
  168. &[type='time'] {
  169. width: initial;
  170. }
  171. }
  172. /* 'Click' inputs */
  173. select,
  174. button:not(.button-vue), .button,
  175. input[type='button'],
  176. input[type='submit'],
  177. input[type='reset'] {
  178. padding: 8px 14px;
  179. font-size: var(--default-font-size);
  180. width: auto;
  181. min-height: $default-height;
  182. cursor: pointer;
  183. box-sizing: border-box;
  184. background-color: var(--color-background-dark);
  185. &:disabled {
  186. cursor: default;
  187. }
  188. }
  189. input:not([type='range']):not(.input-field__input):not([type='submit']):not([type='button']):not([type='reset']):not(.multiselect__input):not(.select2-input):not(.action-input__input),
  190. select,
  191. div[contenteditable=true],
  192. textarea {
  193. margin: 3px 3px 3px 0;
  194. padding: 0 12px;
  195. font-size: var(--default-font-size);
  196. background-color: var(--color-main-background);
  197. color: var(--color-main-text);
  198. border: 2px solid var(--color-border-dark);
  199. height: 36px;
  200. outline: none;
  201. border-radius: var(--border-radius-large);
  202. text-overflow: ellipsis;
  203. cursor: pointer;
  204. &:not(:disabled):hover, &:not(:disabled):focus, &:not(:disabled):active {
  205. border-color: var(--color-primary-element);
  206. }
  207. &:not(:disabled):focus {
  208. cursor: text;
  209. }
  210. }
  211. .multiselect__input, .select2-input {
  212. background-color: var(--color-main-background);
  213. color: var(--color-main-text);
  214. }
  215. textarea, div[contenteditable=true] {
  216. padding: 12px;
  217. height: auto;
  218. }
  219. /* Override the ugly select arrow */
  220. select {
  221. background: var(--icon-triangle-s-dark) no-repeat right 8px center;
  222. appearance: none;
  223. background-color: var(--color-main-background);
  224. padding-right: 28px !important;
  225. }
  226. select,
  227. button:not(.button-vue), .button {
  228. * {
  229. cursor: pointer;
  230. }
  231. &:disabled {
  232. * {
  233. cursor: default;
  234. }
  235. }
  236. }
  237. /* Buttons */
  238. button:not(.button-vue), .button,
  239. input[type='button'],
  240. input[type='submit'],
  241. input[type='reset'] {
  242. font-weight: bold;
  243. border-radius: var(--border-radius-pill);
  244. /* Get rid of the inside dotted line in Firefox */
  245. &::-moz-focus-inner {
  246. border: 0;
  247. }
  248. &.error {
  249. background-color: var(--color-error) !important;
  250. border-color: var(--color-error) !important;
  251. color: #fff !important;
  252. }
  253. }
  254. button:not(.button-vue):not(.action-button), .button {
  255. > span {
  256. /* icon position inside buttons */
  257. &[class^='icon-'],
  258. &[class*=' icon-'] {
  259. display: inline-block;
  260. vertical-align: text-bottom;
  261. opacity: 0.5;
  262. }
  263. }
  264. }
  265. /* Confirm inputs */
  266. input {
  267. &[type='text'],
  268. &[type='password'],
  269. &[type='email'] {
  270. + .icon-confirm {
  271. margin-left: -13px !important;
  272. border-left-color: transparent !important;
  273. border-radius: 0 var(--border-radius-large) var(--border-radius-large) 0 !important;
  274. border-width: 2px;
  275. background-clip: padding-box;
  276. /* Avoid background under border */
  277. background-color: var(--color-main-background) !important;
  278. opacity: 1;
  279. height: $default-height;
  280. width: $default-height;
  281. padding: 7px 6px;
  282. cursor: pointer;
  283. margin-right: 0;
  284. &:disabled {
  285. cursor: default;
  286. @include icon-color('confirm-fade', 'actions', variables.$color-black, 2, true);
  287. }
  288. }
  289. /* only show confirm borders if input is not focused */
  290. &:not(:active):not(:hover):not(:focus){
  291. &:invalid {
  292. + .icon-confirm {
  293. border-color: var(--color-error);
  294. }
  295. }
  296. + .icon-confirm {
  297. &:active,
  298. &:hover,
  299. &:focus {
  300. border-color: var(--color-primary-element) !important;
  301. border-radius: var(--border-radius) !important;
  302. &:disabled {
  303. border-color: var(--color-background-darker) !important;
  304. }
  305. }
  306. }
  307. }
  308. &:active,
  309. &:hover,
  310. &:focus {
  311. + .icon-confirm {
  312. border-color: var(--color-primary-element) !important;
  313. border-left-color: transparent !important;
  314. /* above previous input */
  315. z-index: 2;
  316. }
  317. }
  318. }
  319. }
  320. /* Various Fixes */
  321. button img,
  322. .button img {
  323. cursor: pointer;
  324. }
  325. select,
  326. .button.multiselect {
  327. font-weight: normal;
  328. }
  329. /* Radio & Checkboxes */
  330. $checkbox-radio-size: 14px;
  331. $color-checkbox-radio-white: #fff;
  332. input {
  333. &[type='checkbox'],
  334. &[type='radio'] {
  335. &.radio,
  336. &.checkbox {
  337. position: absolute;
  338. left: -10000px;
  339. top: auto;
  340. width: 1px;
  341. height: 1px;
  342. overflow: hidden;
  343. + label {
  344. user-select: none;
  345. }
  346. &:disabled + label,
  347. &:disabled + label:before {
  348. cursor: default;
  349. }
  350. + label:before {
  351. content: '';
  352. display: inline-block;
  353. height: $checkbox-radio-size;
  354. width: $checkbox-radio-size;
  355. vertical-align: middle;
  356. border-radius: 50%;
  357. margin: 0 6px 3px 3px;
  358. border: 1px solid var(--color-text-lighter);
  359. }
  360. &:not(:disabled):not(:checked) + label:hover:before,
  361. &:focus + label:before {
  362. border-color: var(--color-primary-element);
  363. }
  364. &:focus-visible + label {
  365. outline-style: solid;
  366. outline-color: var(--color-main-text);
  367. outline-width: 1px;
  368. outline-offset: 2px;
  369. }
  370. &:checked + label:before,
  371. &.checkbox:indeterminate + label:before {
  372. /* ^ :indeterminate have a strange behavior on radio,
  373. so we respecified the checkbox class again to be safe */
  374. box-shadow: inset 0px 0px 0px 2px var(--color-main-background);
  375. background-color: var(--color-primary-element);
  376. border-color: var(--color-primary-element);
  377. }
  378. &:disabled + label:before {
  379. border: 1px solid var(--color-text-lighter);
  380. background-color: var(--color-text-maxcontrast) !important; /* override other status */
  381. }
  382. &:checked:disabled + label:before {
  383. background-color: var(--color-text-maxcontrast);
  384. }
  385. // Detail description below label of checkbox or radio button
  386. & + label ~ em {
  387. display: inline-block;
  388. margin-left: 25px;
  389. }
  390. & + label ~ em:last-of-type {
  391. margin-bottom: $checkbox-radio-size;
  392. }
  393. }
  394. &.checkbox {
  395. + label:before {
  396. border-radius: 1px;
  397. height: $checkbox-radio-size;
  398. width: $checkbox-radio-size;
  399. box-shadow: none !important;
  400. background-position: center;
  401. }
  402. &:checked + label:before {
  403. background-image: url('../img/actions/checkbox-mark.svg');
  404. }
  405. &:indeterminate + label:before {
  406. background-image: url('../img/actions/checkbox-mixed.svg');
  407. }
  408. }
  409. /* We do not use the variables as we keep the colours as white for this variant */
  410. &.radio--white,
  411. &.checkbox--white {
  412. + label:before,
  413. &:focus + label:before {
  414. border-color: darken($color-checkbox-radio-white, 27%);
  415. }
  416. &:not(:disabled):not(:checked) + label:hover:before {
  417. border-color: $color-checkbox-radio-white;
  418. }
  419. &:checked + label:before {
  420. box-shadow: inset 0px 0px 0px 2px var(--color-main-background);
  421. background-color: darken($color-checkbox-radio-white, 14%);
  422. border-color: darken($color-checkbox-radio-white, 14%);
  423. }
  424. &:disabled + label:before {
  425. background-color: darken($color-checkbox-radio-white, 27%) !important; /* override other status */
  426. border-color: rgba($color-checkbox-radio-white, 0.4) !important; /* override other status */
  427. }
  428. &:checked:disabled + label:before {
  429. box-shadow: inset 0px 0px 0px 2px var(--color-main-background);
  430. border-color: rgba($color-checkbox-radio-white, 0.4) !important; /* override other status */
  431. background-color: darken($color-checkbox-radio-white, 27%);
  432. }
  433. }
  434. &.checkbox--white {
  435. &:checked + label:before,
  436. &:indeterminate + label:before {
  437. background-color: transparent !important; /* Override default checked */
  438. border-color: $color-checkbox-radio-white !important; /* Override default checked */
  439. background-image: url('../img/actions/checkbox-mark-white.svg');
  440. }
  441. &:indeterminate + label:before {
  442. background-image: url('../img/actions/checkbox-mixed-white.svg');
  443. }
  444. &:disabled + label:before {
  445. opacity: 0.7; /* No other choice for white background image */
  446. }
  447. }
  448. }
  449. }
  450. /* Select2 overriding. Merged to core with vendor stylesheet */
  451. div.select2-drop {
  452. margin-top: -2px;
  453. background-color: var(--color-main-background);
  454. &.select2-drop-active {
  455. border-color: var(--color-border-dark);
  456. }
  457. .avatar {
  458. display: inline-block;
  459. margin-right: 8px;
  460. vertical-align: middle;
  461. img {
  462. cursor: pointer;
  463. }
  464. }
  465. .select2-search input {
  466. min-height: auto;
  467. background: var(--icon-search-dark) no-repeat right center !important;
  468. background-origin: content-box !important;
  469. }
  470. .select2-results {
  471. max-height: 250px;
  472. margin: 0;
  473. padding: 0;
  474. .select2-result-label {
  475. white-space: nowrap;
  476. overflow: hidden;
  477. text-overflow: ellipsis;
  478. span {
  479. cursor: pointer;
  480. em {
  481. cursor: inherit;
  482. background: unset;
  483. }
  484. }
  485. }
  486. .select2-result,
  487. .select2-no-results,
  488. .select2-searching {
  489. position: relative;
  490. display: list-item;
  491. padding: 12px;
  492. background-color: transparent;
  493. cursor: pointer;
  494. color: var(--color-text-lighter);
  495. }
  496. .select2-result {
  497. &.select2-selected {
  498. background-color: var(--color-background-dark);
  499. }
  500. }
  501. .select2-highlighted {
  502. background-color: var(--color-background-dark);
  503. color: var(--color-main-text);
  504. }
  505. }
  506. }
  507. .select2-chosen,
  508. #select2-drop {
  509. .avatar,
  510. .avatar img {
  511. cursor: pointer;
  512. }
  513. }
  514. div.select2-container-multi {
  515. .select2-choices,
  516. &.select2-container-active .select2-choices {
  517. box-shadow: none;
  518. white-space: nowrap;
  519. text-overflow: ellipsis;
  520. background: var(--color-main-background);
  521. color: var(--color-text-lighter) !important;
  522. box-sizing: content-box;
  523. border-radius: var(--border-radius-large);
  524. border: 2px solid var(--color-border-dark);
  525. margin: 0;
  526. padding: 6px;
  527. min-height: 44px;
  528. &:focus-within {
  529. border-color: var(--color-primary)
  530. }
  531. .select2-search-choice {
  532. line-height: 20px;
  533. padding-left: 5px;
  534. &.select2-search-choice-focus,
  535. &:hover,
  536. &:active,
  537. & {
  538. background-image: none;
  539. background-color: var(--color-main-background);
  540. color: var(--color-text-lighter);
  541. border: 1px solid var(--color-border-dark);
  542. }
  543. .select2-search-choice-close {
  544. display: none;
  545. }
  546. }
  547. .select2-search-field input {
  548. line-height: 20px;
  549. min-height: 28px;
  550. max-height: 28px;
  551. color: var(--color-main-text);
  552. &.select2-active {
  553. background: none !important;
  554. }
  555. }
  556. }
  557. }
  558. div.select2-container {
  559. margin: 3px 3px 3px 0;
  560. &.select2-container-multi .select2-choices {
  561. display: flex;
  562. flex-wrap: wrap;
  563. li {
  564. float: none;
  565. }
  566. }
  567. a.select2-choice {
  568. box-shadow: none;
  569. white-space: nowrap;
  570. text-overflow: ellipsis;
  571. background: var(--color-main-background);
  572. color: var(--color-text-lighter) !important;
  573. box-sizing: content-box;
  574. border-radius: var(--border-radius-large);
  575. border: 2px solid var(--color-border-dark);
  576. margin: 0;
  577. padding: 6px 12px;
  578. min-height: 44px;
  579. &:focus-within {
  580. border-color: var(--color-primary)
  581. }
  582. .select2-search-choice {
  583. line-height: 20px;
  584. padding-left: 5px;
  585. background-image: none;
  586. background-color: var(--color-background-dark);
  587. border-color: var(--color-background-dark);
  588. .select2-search-choice-close {
  589. display: none;
  590. }
  591. &.select2-search-choice-focus,
  592. &:hover {
  593. background-color: var(--color-border);
  594. border-color: var(--color-border);
  595. }
  596. }
  597. .select2-arrow {
  598. background: none;
  599. border-radius: 0;
  600. border: none;
  601. b {
  602. background: var(--icon-triangle-s-dark) no-repeat center !important;
  603. opacity: .5;
  604. }
  605. }
  606. &:hover .select2-arrow b,
  607. &:focus .select2-arrow b,
  608. &:active .select2-arrow b {
  609. opacity: .7;
  610. }
  611. .select2-search-field input {
  612. line-height: 20px;
  613. }
  614. }
  615. }
  616. /* Vue v-select */
  617. .v-select {
  618. margin: 3px 3px 3px 0;
  619. display: inline-block;
  620. .dropdown-toggle {
  621. display: flex !important;
  622. flex-wrap: wrap;
  623. .selected-tag {
  624. line-height: 20px;
  625. padding-left: 5px;
  626. background-image: none;
  627. background-color: var(--color-main-background);
  628. color: var(--color-text-lighter);
  629. border: 1px solid var(--color-border-dark);
  630. display: inline-flex;
  631. align-items: center;
  632. .close {
  633. margin-left: 3px;
  634. }
  635. }
  636. }
  637. .dropdown-menu {
  638. padding: 0;
  639. li {
  640. padding: 5px;
  641. position: relative;
  642. display: list-item;
  643. background-color: transparent;
  644. cursor: pointer;
  645. color: var(--color-text-lighter);
  646. a {
  647. white-space: nowrap;
  648. overflow: hidden;
  649. text-overflow: ellipsis;
  650. height: 25px;
  651. padding: 3px 7px 4px 2px;
  652. margin: 0;
  653. cursor: pointer;
  654. min-height: 1em;
  655. -webkit-touch-callout: none;
  656. -webkit-user-select: none;
  657. -moz-user-select: none;
  658. -ms-user-select: none;
  659. user-select: none;
  660. display: inline-flex;
  661. align-items: center;
  662. background-color: transparent !important;
  663. color: inherit !important;
  664. &::before {
  665. content: ' ';
  666. background-image: var(--icon-checkmark-dark);
  667. background-repeat: no-repeat;
  668. background-position: center;
  669. min-width: 16px;
  670. min-height: 16px;
  671. display: block;
  672. opacity: 0.5;
  673. margin-right: 5px;
  674. visibility: hidden;
  675. }
  676. }
  677. &.highlight {
  678. color: var(--color-main-text);
  679. }
  680. &.active > a {
  681. background-color: var(--color-background-dark);
  682. color: var(--color-main-text);
  683. &::before {
  684. visibility: visible;
  685. }
  686. }
  687. }
  688. }
  689. }
  690. /* Vue multiselect */
  691. .multiselect.multiselect-vue {
  692. margin: 1px 2px;
  693. padding: 0 !important;
  694. display: inline-block;
  695. width: 160px;
  696. position: relative;
  697. background-color: var(--color-main-background);
  698. &.multiselect--active {
  699. /* Opened: force display the input */
  700. input.multiselect__input {
  701. opacity: 1 !important;
  702. cursor: text !important;
  703. }
  704. }
  705. &.multiselect--disabled,
  706. &.multiselect--disabled .multiselect__single {
  707. background-color: var(--color-background-dark) !important;
  708. }
  709. .multiselect__tags {
  710. /* space between tags and limit tag */
  711. $space-between: 5px;
  712. display: flex;
  713. flex-wrap: nowrap;
  714. overflow: hidden;
  715. border: 1px solid var(--color-border-dark);
  716. cursor: pointer;
  717. position: relative;
  718. border-radius: var(--border-radius);
  719. height: $default-height;
  720. /* tag wrapper */
  721. .multiselect__tags-wrap {
  722. align-items: center;
  723. display: inline-flex;
  724. overflow: hidden;
  725. max-width: 100%;
  726. position: relative;
  727. padding: 3px $space-between;
  728. flex-grow: 1;
  729. /* no tags or simple select? Show input directly
  730. input is used to display single value */
  731. &:empty ~ input.multiselect__input {
  732. opacity: 1 !important;
  733. /* hide default empty text, show input instead */
  734. + span:not(.multiselect__single) {
  735. display: none;
  736. }
  737. }
  738. /* selected tag */
  739. .multiselect__tag {
  740. flex: 1 0 0;
  741. line-height: 20px;
  742. padding: 1px 5px;
  743. background-image: none;
  744. color: var(--color-text-lighter);
  745. border: 1px solid var(--color-border-dark);
  746. display: inline-flex;
  747. align-items: center;
  748. border-radius: var(--border-radius);
  749. /* require to override the default width
  750. and force the tag to shring properly */
  751. min-width: 0;
  752. max-width: 50%;
  753. max-width: fit-content;
  754. max-width: -moz-fit-content;
  755. /* css hack, detect if more than two tags
  756. if so, flex-basis is set to half */
  757. &:only-child {
  758. flex: 0 1 auto;
  759. }
  760. &:not(:last-child) {
  761. margin-right: $space-between;
  762. }
  763. /* ellipsis the groups to be sure
  764. we display at least two of them */
  765. > span {
  766. white-space: nowrap;
  767. text-overflow: ellipsis;
  768. overflow: hidden;
  769. }
  770. }
  771. }
  772. /* Single select default value */
  773. .multiselect__single {
  774. padding: 8px 10px;
  775. flex: 0 0 100%;
  776. z-index: 1; /* above input */
  777. background-color: var(--color-main-background);
  778. cursor: pointer;
  779. line-height: 17px;
  780. }
  781. /* displayed text if tag limit reached */
  782. .multiselect__strong,
  783. .multiselect__limit {
  784. flex: 0 0 auto;
  785. line-height: 20px;
  786. color: var(--color-text-lighter);
  787. display: inline-flex;
  788. align-items: center;
  789. opacity: .7;
  790. margin-right: $space-between;
  791. /* above the input */
  792. z-index: 5;
  793. }
  794. /* default multiselect input for search and placeholder */
  795. input.multiselect__input {
  796. width: 100% !important;
  797. position: absolute !important;
  798. margin: 0;
  799. opacity: 0;
  800. /* let's leave it on top of tags but hide it */
  801. height: 100%;
  802. border: none;
  803. /* override hide to force show the placeholder */
  804. display: block !important;
  805. /* only when not active */
  806. cursor: pointer;
  807. }
  808. }
  809. /* results wrapper */
  810. .multiselect__content-wrapper {
  811. position: absolute;
  812. width: 100%;
  813. margin-top: -1px;
  814. border: 1px solid var(--color-border-dark);
  815. background: var(--color-main-background);
  816. z-index: 50;
  817. max-height: 175px !important; // 5 items and a half
  818. overflow-y: auto;
  819. .multiselect__content {
  820. width: 100%;
  821. padding: 5px 0;
  822. }
  823. li {
  824. padding: 5px;
  825. position: relative;
  826. display: flex;
  827. align-items: center;
  828. background-color: transparent;
  829. &,
  830. span {
  831. cursor: pointer;
  832. }
  833. > span {
  834. white-space: nowrap;
  835. overflow: hidden;
  836. text-overflow: ellipsis;
  837. height: 20px;
  838. margin: 0;
  839. min-height: 1em;
  840. -webkit-touch-callout: none;
  841. -webkit-user-select: none;
  842. -moz-user-select: none;
  843. -ms-user-select: none;
  844. user-select: none;
  845. display: inline-flex;
  846. align-items: center;
  847. background-color: transparent !important;
  848. color: var(--color-text-lighter);
  849. width: 100%;
  850. /* selected checkmark icon */
  851. &::before {
  852. content: ' ';
  853. background-image: var(--icon-checkmark-dark);
  854. background-repeat: no-repeat;
  855. background-position: center;
  856. min-width: 16px;
  857. min-height: 16px;
  858. display: block;
  859. opacity: .5;
  860. margin-right: 5px;
  861. visibility: hidden;
  862. }
  863. &.multiselect__option--disabled {
  864. background-color: var(--color-background-dark);
  865. opacity: .5;
  866. }
  867. /* add the prop tag-placeholder="create" to add the +
  868. * icon on top of an unknown-and-ready-to-be-created entry
  869. */
  870. &[data-select='create'] {
  871. &::before {
  872. background-image: var(--icon-add-dark);
  873. visibility: visible;
  874. }
  875. }
  876. &.multiselect__option--highlight {
  877. color: var(--color-main-text);
  878. }
  879. &:not(.multiselect__option--disabled):hover::before {
  880. opacity: .3;
  881. }
  882. &.multiselect__option--selected,
  883. &:not(.multiselect__option--disabled):hover {
  884. &::before {
  885. visibility: visible;
  886. }
  887. }
  888. }
  889. }
  890. }
  891. }
  892. /* Progressbar */
  893. progress:not(.vue) {
  894. display: block;
  895. width: 100%;
  896. padding: 0;
  897. border: 0 none;
  898. background-color: var(--color-background-dark);
  899. border-radius: var(--border-radius);
  900. flex-basis: 100%;
  901. height: 5px;
  902. overflow: hidden;
  903. &.warn {
  904. &::-moz-progress-bar {
  905. background: var(--color-error);
  906. }
  907. &::-webkit-progress-value {
  908. background: var(--color-error);
  909. }
  910. }
  911. &::-webkit-progress-bar {
  912. background: transparent;
  913. }
  914. &::-moz-progress-bar {
  915. border-radius: var(--border-radius);
  916. background: var(--color-primary);
  917. transition: 250ms all ease-in-out;
  918. }
  919. &::-webkit-progress-value {
  920. border-radius: var(--border-radius);
  921. background: var(--color-primary);
  922. transition: 250ms all ease-in-out;
  923. }
  924. }
  925. /* Animation */
  926. @keyframes shake {
  927. 10%,
  928. 90% {
  929. transform: translate(-1px);
  930. }
  931. 20%,
  932. 80% {
  933. transform: translate(2px);
  934. }
  935. 30%,
  936. 50%,
  937. 70% {
  938. transform: translate(-4px);
  939. }
  940. 40%,
  941. 60% {
  942. transform: translate(4px);
  943. }
  944. }
  945. .shake {
  946. animation-name: shake;
  947. animation-duration: .7s;
  948. animation-timing-function: ease-out;
  949. }
  950. // Keep the labels for screen readers but hide them since we use placeholders
  951. // Same as .hidden-visually
  952. label.infield {
  953. position: absolute;
  954. left: -10000px;
  955. top: -10000px;
  956. width: 1px;
  957. height: 1px;
  958. overflow: hidden;
  959. }
  960. ::placeholder,
  961. ::-ms-input-placeholder,
  962. ::-webkit-input-placeholder {
  963. color: var(--color-text-maxcontrast);
  964. font-size: var(--default-font-size);
  965. }