inputs.scss 23 KB

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