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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972
  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,
  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,
  161. input[type='button'],
  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 {
  176. * {
  177. cursor: pointer;
  178. }
  179. &:disabled {
  180. * {
  181. cursor: default;
  182. }
  183. }
  184. }
  185. /* Buttons */
  186. button:not(.button-vue), .button,
  187. input[type='button'],
  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 {
  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. em {
  461. cursor: inherit;
  462. background: unset;
  463. }
  464. }
  465. }
  466. .select2-result,
  467. .select2-no-results,
  468. .select2-searching {
  469. position: relative;
  470. display: list-item;
  471. padding: 12px;
  472. background-color: transparent;
  473. cursor: pointer;
  474. color: var(--color-text-lighter);
  475. }
  476. .select2-result {
  477. &.select2-selected {
  478. background-color: var(--color-background-dark);
  479. }
  480. }
  481. .select2-highlighted {
  482. background-color: var(--color-background-dark);
  483. color: var(--color-main-text);
  484. }
  485. }
  486. }
  487. .select2-chosen,
  488. #select2-drop {
  489. .avatar,
  490. .avatar img {
  491. cursor: pointer;
  492. }
  493. }
  494. div.select2-container-multi {
  495. .select2-choices,
  496. &.select2-container-active .select2-choices {
  497. box-shadow: none;
  498. white-space: nowrap;
  499. text-overflow: ellipsis;
  500. background: var(--color-main-background);
  501. color: var(--color-text-lighter) !important;
  502. box-sizing: content-box;
  503. border-radius: var(--border-radius);
  504. border: 1px solid var(--color-border-dark);
  505. margin: 0;
  506. padding: 2px 0;
  507. min-height: auto;
  508. .select2-search-choice {
  509. line-height: 20px;
  510. padding-left: 5px;
  511. &.select2-search-choice-focus,
  512. &:hover,
  513. &:active,
  514. & {
  515. background-image: none;
  516. background-color: var(--color-main-background);
  517. color: var(--color-text-lighter);
  518. border: 1px solid var(--color-border-dark);
  519. }
  520. .select2-search-choice-close {
  521. display: none;
  522. }
  523. }
  524. .select2-search-field input {
  525. line-height: 20px;
  526. &.select2-active {
  527. background: none !important;
  528. }
  529. }
  530. }
  531. }
  532. div.select2-container {
  533. margin: 3px 3px 3px 0;
  534. &.select2-container-multi .select2-choices {
  535. display: flex;
  536. flex-wrap: wrap;
  537. li {
  538. float: none;
  539. }
  540. }
  541. a.select2-choice {
  542. box-shadow: none;
  543. white-space: nowrap;
  544. text-overflow: ellipsis;
  545. background: var(--color-main-background);
  546. color: var(--color-text-lighter) !important;
  547. box-sizing: content-box;
  548. border-radius: var(--border-radius);
  549. border: 1px solid var(--color-border-dark);
  550. margin: 0;
  551. padding: 2px 0;
  552. padding-left: 6px;
  553. min-height: auto;
  554. .select2-search-choice {
  555. line-height: 20px;
  556. padding-left: 5px;
  557. background-image: none;
  558. background-color: var(--color-background-dark);
  559. border-color: var(--color-background-dark);
  560. .select2-search-choice-close {
  561. display: none;
  562. }
  563. &.select2-search-choice-focus,
  564. &:hover {
  565. background-color: var(--color-border);
  566. border-color: var(--color-border);
  567. }
  568. }
  569. .select2-arrow {
  570. background: none;
  571. border-radius: 0;
  572. border: none;
  573. b {
  574. background: var(--icon-triangle-s-000) no-repeat center !important;
  575. opacity: .5;
  576. }
  577. }
  578. &:hover .select2-arrow b,
  579. &:focus .select2-arrow b,
  580. &:active .select2-arrow b {
  581. opacity: .7;
  582. }
  583. .select2-search-field input {
  584. line-height: 20px;
  585. }
  586. }
  587. }
  588. /* Vue v-select */
  589. .v-select {
  590. margin: 3px 3px 3px 0;
  591. display: inline-block;
  592. .dropdown-toggle {
  593. display: flex !important;
  594. flex-wrap: wrap;
  595. .selected-tag {
  596. line-height: 20px;
  597. padding-left: 5px;
  598. background-image: none;
  599. background-color: var(--color-main-background);
  600. color: var(--color-text-lighter);
  601. border: 1px solid var(--color-border-dark);
  602. display: inline-flex;
  603. align-items: center;
  604. .close {
  605. margin-left: 3px;
  606. }
  607. }
  608. }
  609. .dropdown-menu {
  610. padding: 0;
  611. li {
  612. padding: 5px;
  613. position: relative;
  614. display: list-item;
  615. background-color: transparent;
  616. cursor: pointer;
  617. color: var(--color-text-lighter);
  618. a {
  619. white-space: nowrap;
  620. overflow: hidden;
  621. text-overflow: ellipsis;
  622. height: 25px;
  623. padding: 3px 7px 4px 2px;
  624. margin: 0;
  625. cursor: pointer;
  626. min-height: 1em;
  627. -webkit-touch-callout: none;
  628. -webkit-user-select: none;
  629. -moz-user-select: none;
  630. -ms-user-select: none;
  631. user-select: none;
  632. display: inline-flex;
  633. align-items: center;
  634. background-color: transparent !important;
  635. color: inherit !important;
  636. &::before {
  637. content: ' ';
  638. background-image: var(--icon-checkmark-000);
  639. background-repeat: no-repeat;
  640. background-position: center;
  641. min-width: 16px;
  642. min-height: 16px;
  643. display: block;
  644. opacity: 0.5;
  645. margin-right: 5px;
  646. visibility: hidden;
  647. }
  648. }
  649. &.highlight {
  650. color: var(--color-main-text);
  651. }
  652. &.active > a {
  653. background-color: var(--color-background-dark);
  654. color: var(--color-main-text);
  655. &::before {
  656. visibility: visible;
  657. }
  658. }
  659. }
  660. }
  661. }
  662. /* Vue multiselect */
  663. .multiselect.multiselect-vue {
  664. margin: 1px 2px;
  665. padding: 0 !important;
  666. display: inline-block;
  667. width: 160px;
  668. position: relative;
  669. background-color: var(--color-main-background);
  670. &.multiselect--active {
  671. /* Opened: force display the input */
  672. input.multiselect__input {
  673. opacity: 1 !important;
  674. cursor: text !important;
  675. }
  676. }
  677. &.multiselect--disabled,
  678. &.multiselect--disabled .multiselect__single {
  679. background-color: var(--color-background-dark) !important;
  680. }
  681. .multiselect__tags {
  682. /* space between tags and limit tag */
  683. $space-between: 5px;
  684. display: flex;
  685. flex-wrap: nowrap;
  686. overflow: hidden;
  687. border: 1px solid var(--color-border-dark);
  688. cursor: pointer;
  689. position: relative;
  690. border-radius: var(--border-radius);
  691. height: $default-height;
  692. /* tag wrapper */
  693. .multiselect__tags-wrap {
  694. align-items: center;
  695. display: inline-flex;
  696. overflow: hidden;
  697. max-width: 100%;
  698. position: relative;
  699. padding: 3px $space-between;
  700. flex-grow: 1;
  701. /* no tags or simple select? Show input directly
  702. input is used to display single value */
  703. &:empty ~ input.multiselect__input {
  704. opacity: 1 !important;
  705. /* hide default empty text, show input instead */
  706. + span:not(.multiselect__single) {
  707. display: none;
  708. }
  709. }
  710. /* selected tag */
  711. .multiselect__tag {
  712. flex: 1 0 0;
  713. line-height: 20px;
  714. padding: 1px 5px;
  715. background-image: none;
  716. color: var(--color-text-lighter);
  717. border: 1px solid var(--color-border-dark);
  718. display: inline-flex;
  719. align-items: center;
  720. border-radius: var(--border-radius);
  721. /* require to override the default width
  722. and force the tag to shring properly */
  723. min-width: 0;
  724. max-width: 50%;
  725. max-width: fit-content;
  726. max-width: -moz-fit-content;
  727. /* css hack, detect if more than two tags
  728. if so, flex-basis is set to half */
  729. &:only-child {
  730. flex: 0 1 auto;
  731. }
  732. &:not(:last-child) {
  733. margin-right: $space-between;
  734. }
  735. /* ellipsis the groups to be sure
  736. we display at least two of them */
  737. > span {
  738. white-space: nowrap;
  739. text-overflow: ellipsis;
  740. overflow: hidden;
  741. }
  742. }
  743. }
  744. /* Single select default value */
  745. .multiselect__single {
  746. padding: 8px 10px;
  747. flex: 0 0 100%;
  748. z-index: 1; /* above input */
  749. background-color: var(--color-main-background);
  750. cursor: pointer;
  751. line-height: 17px;
  752. }
  753. /* displayed text if tag limit reached */
  754. .multiselect__strong,
  755. .multiselect__limit {
  756. flex: 0 0 auto;
  757. line-height: 20px;
  758. color: var(--color-text-lighter);
  759. display: inline-flex;
  760. align-items: center;
  761. opacity: .7;
  762. margin-right: $space-between;
  763. /* above the input */
  764. z-index: 5;
  765. }
  766. /* default multiselect input for search and placeholder */
  767. input.multiselect__input {
  768. width: 100% !important;
  769. position: absolute !important;
  770. margin: 0;
  771. opacity: 0;
  772. /* let's leave it on top of tags but hide it */
  773. height: 100%;
  774. border: none;
  775. /* override hide to force show the placeholder */
  776. display: block !important;
  777. /* only when not active */
  778. cursor: pointer;
  779. }
  780. }
  781. /* results wrapper */
  782. .multiselect__content-wrapper {
  783. position: absolute;
  784. width: 100%;
  785. margin-top: -1px;
  786. border: 1px solid var(--color-border-dark);
  787. background: var(--color-main-background);
  788. z-index: 50;
  789. max-height: 175px !important; // 5 items and a half
  790. overflow-y: auto;
  791. .multiselect__content {
  792. width: 100%;
  793. padding: 5px 0;
  794. }
  795. li {
  796. padding: 5px;
  797. position: relative;
  798. display: flex;
  799. align-items: center;
  800. background-color: transparent;
  801. &,
  802. span {
  803. cursor: pointer;
  804. }
  805. > span {
  806. white-space: nowrap;
  807. overflow: hidden;
  808. text-overflow: ellipsis;
  809. height: 20px;
  810. margin: 0;
  811. min-height: 1em;
  812. -webkit-touch-callout: none;
  813. -webkit-user-select: none;
  814. -moz-user-select: none;
  815. -ms-user-select: none;
  816. user-select: none;
  817. display: inline-flex;
  818. align-items: center;
  819. background-color: transparent !important;
  820. color: var(--color-text-lighter);
  821. width: 100%;
  822. /* selected checkmark icon */
  823. &::before {
  824. content: ' ';
  825. background-image: var(--icon-checkmark-000);
  826. background-repeat: no-repeat;
  827. background-position: center;
  828. min-width: 16px;
  829. min-height: 16px;
  830. display: block;
  831. opacity: .5;
  832. margin-right: 5px;
  833. visibility: hidden;
  834. }
  835. &.multiselect__option--disabled {
  836. background-color: var(--color-background-dark);
  837. opacity: .5;
  838. }
  839. /* add the prop tag-placeholder="create" to add the +
  840. * icon on top of an unknown-and-ready-to-be-created entry
  841. */
  842. &[data-select='create'] {
  843. &::before {
  844. background-image: var(--icon-add-000);
  845. visibility: visible;
  846. }
  847. }
  848. &.multiselect__option--highlight {
  849. color: var(--color-main-text);
  850. }
  851. &:not(.multiselect__option--disabled):hover::before {
  852. opacity: .3;
  853. }
  854. &.multiselect__option--selected,
  855. &:not(.multiselect__option--disabled):hover {
  856. &::before {
  857. visibility: visible;
  858. }
  859. }
  860. }
  861. }
  862. }
  863. }
  864. /* Progressbar */
  865. progress:not(.vue) {
  866. display: block;
  867. width: 100%;
  868. padding: 0;
  869. border: 0 none;
  870. background-color: var(--color-background-dark);
  871. border-radius: var(--border-radius);
  872. flex-basis: 100%;
  873. height: 5px;
  874. overflow: hidden;
  875. &.warn {
  876. &::-moz-progress-bar {
  877. background: var(--color-error);
  878. }
  879. &::-webkit-progress-value {
  880. background: var(--color-error);
  881. }
  882. }
  883. &::-webkit-progress-bar {
  884. background: transparent;
  885. }
  886. &::-moz-progress-bar {
  887. border-radius: var(--border-radius);
  888. background: var(--color-primary);
  889. transition: 250ms all ease-in-out;
  890. }
  891. &::-webkit-progress-value {
  892. border-radius: var(--border-radius);
  893. background: var(--color-primary);
  894. transition: 250ms all ease-in-out;
  895. }
  896. }
  897. /* Animation */
  898. @keyframes shake {
  899. 10%,
  900. 90% {
  901. transform: translate(-1px);
  902. }
  903. 20%,
  904. 80% {
  905. transform: translate(2px);
  906. }
  907. 30%,
  908. 50%,
  909. 70% {
  910. transform: translate(-4px);
  911. }
  912. 40%,
  913. 60% {
  914. transform: translate(4px);
  915. }
  916. }
  917. .shake {
  918. animation-name: shake;
  919. animation-duration: .7s;
  920. animation-timing-function: ease-out;
  921. }
  922. // Keep the labels for screen readers but hide them since we use placeholders
  923. // Same as .hidden-visually
  924. label.infield {
  925. position: absolute;
  926. left: -10000px;
  927. top: -10000px;
  928. width: 1px;
  929. height: 1px;
  930. overflow: hidden;
  931. }
  932. ::placeholder,
  933. ::-ms-input-placeholder,
  934. ::-webkit-input-placeholder {
  935. color: var(--color-text-maxcontrast);
  936. }