You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

inputs.scss 23KB

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