inputs.scss 20 KB

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