1
0

inputs.scss 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855
  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: var(--color-primary-element);
  236. }
  237. &:not(:disabled):focus {
  238. cursor: text;
  239. }
  240. }
  241. .multiselect__input, .select2-input {
  242. background-color: var(--color-main-background);
  243. color: var(--color-main-text);
  244. }
  245. textarea, div[contenteditable=true] {
  246. padding: 12px;
  247. height: auto;
  248. }
  249. /* Override the ugly select arrow */
  250. select {
  251. background: var(--icon-triangle-s-dark) no-repeat right 8px center;
  252. appearance: none;
  253. background-color: var(--color-main-background);
  254. padding-right: 28px !important;
  255. }
  256. select,
  257. button:not(
  258. .button-vue,
  259. [class^="vs__"]
  260. ),
  261. .button {
  262. * {
  263. cursor: pointer;
  264. }
  265. &:disabled {
  266. * {
  267. cursor: default;
  268. }
  269. }
  270. }
  271. /* Buttons */
  272. button:not(
  273. .button-vue,
  274. [class^="vs__"]
  275. ),
  276. .button,
  277. input[type='button'],
  278. input[type='submit'],
  279. input[type='reset'] {
  280. font-weight: bold;
  281. border-radius: var(--border-radius-pill);
  282. /* Get rid of the inside dotted line in Firefox */
  283. &::-moz-focus-inner {
  284. border: 0;
  285. }
  286. &.error {
  287. background-color: var(--color-error) !important;
  288. border-color: var(--color-error) !important;
  289. color: #fff !important;
  290. }
  291. }
  292. button:not(
  293. .button-vue,
  294. .action-button,
  295. [class^="vs__"]
  296. ),
  297. .button {
  298. > span {
  299. /* icon position inside buttons */
  300. &[class^='icon-'],
  301. &[class*=' icon-'] {
  302. display: inline-block;
  303. vertical-align: text-bottom;
  304. opacity: 0.5;
  305. }
  306. }
  307. }
  308. /* Confirm inputs */
  309. input {
  310. &[type='text'],
  311. &[type='password'],
  312. &[type='email'] {
  313. + .icon-confirm {
  314. margin-left: -13px !important;
  315. border-left-color: transparent !important;
  316. border-radius: 0 var(--border-radius-large) var(--border-radius-large) 0 !important;
  317. border-width: 2px;
  318. background-clip: padding-box;
  319. /* Avoid background under border */
  320. background-color: var(--color-main-background) !important;
  321. opacity: 1;
  322. height: $default-height;
  323. width: $default-height;
  324. padding: 7px 6px;
  325. cursor: pointer;
  326. margin-right: 0;
  327. &:disabled {
  328. cursor: default;
  329. @include icon-color('confirm-fade', 'actions', variables.$color-black, 2, true);
  330. }
  331. }
  332. /* only show confirm borders if input is not focused */
  333. &:not(:active):not(:hover):not(:focus){
  334. &:invalid {
  335. + .icon-confirm {
  336. border-color: var(--color-error);
  337. }
  338. }
  339. + .icon-confirm {
  340. &:active,
  341. &:hover,
  342. &:focus {
  343. border-color: var(--color-primary-element) !important;
  344. border-radius: var(--border-radius) !important;
  345. &:disabled {
  346. border-color: var(--color-background-darker) !important;
  347. }
  348. }
  349. }
  350. }
  351. &:active,
  352. &:hover,
  353. &:focus {
  354. + .icon-confirm {
  355. border-color: var(--color-primary-element) !important;
  356. border-left-color: transparent !important;
  357. /* above previous input */
  358. z-index: 2;
  359. }
  360. }
  361. }
  362. }
  363. /* Various Fixes */
  364. button img,
  365. .button img {
  366. cursor: pointer;
  367. }
  368. select,
  369. .button.multiselect {
  370. font-weight: normal;
  371. }
  372. /* Radio & Checkboxes */
  373. $checkbox-radio-size: 14px;
  374. $color-checkbox-radio-white: #fff;
  375. input {
  376. &[type='checkbox'],
  377. &[type='radio'] {
  378. &.radio,
  379. &.checkbox {
  380. position: absolute;
  381. left: -10000px;
  382. top: auto;
  383. width: 1px;
  384. height: 1px;
  385. overflow: hidden;
  386. + label {
  387. user-select: none;
  388. }
  389. &:disabled + label,
  390. &:disabled + label:before {
  391. cursor: default;
  392. }
  393. + label:before {
  394. content: '';
  395. display: inline-block;
  396. height: $checkbox-radio-size;
  397. width: $checkbox-radio-size;
  398. vertical-align: middle;
  399. border-radius: 50%;
  400. margin: 0 6px 3px 3px;
  401. border: 1px solid var(--color-text-lighter);
  402. }
  403. &:not(:disabled):not(:checked) + label:hover:before,
  404. &:focus + label:before {
  405. border-color: var(--color-primary-element);
  406. }
  407. &:focus-visible + label {
  408. outline-style: solid;
  409. outline-color: var(--color-main-text);
  410. outline-width: 1px;
  411. outline-offset: 2px;
  412. }
  413. &:checked + label:before,
  414. &.checkbox:indeterminate + label:before {
  415. /* ^ :indeterminate have a strange behavior on radio,
  416. so we respecified the checkbox class again to be safe */
  417. box-shadow: inset 0px 0px 0px 2px var(--color-main-background);
  418. background-color: var(--color-primary-element);
  419. border-color: var(--color-primary-element);
  420. }
  421. &:disabled + label:before {
  422. border: 1px solid var(--color-text-lighter);
  423. background-color: var(--color-text-maxcontrast) !important; /* override other status */
  424. }
  425. &:checked:disabled + label:before {
  426. background-color: var(--color-text-maxcontrast);
  427. }
  428. // Detail description below label of checkbox or radio button
  429. & + label ~ em {
  430. display: inline-block;
  431. margin-left: 25px;
  432. }
  433. & + label ~ em:last-of-type {
  434. margin-bottom: $checkbox-radio-size;
  435. }
  436. }
  437. &.checkbox {
  438. + label:before {
  439. border-radius: 1px;
  440. height: $checkbox-radio-size;
  441. width: $checkbox-radio-size;
  442. box-shadow: none !important;
  443. background-position: center;
  444. }
  445. &:checked + label:before {
  446. background-image: url('../img/actions/checkbox-mark.svg');
  447. }
  448. &:indeterminate + label:before {
  449. background-image: url('../img/actions/checkbox-mixed.svg');
  450. }
  451. }
  452. /* We do not use the variables as we keep the colours as white for this variant */
  453. &.radio--white,
  454. &.checkbox--white {
  455. + label:before,
  456. &:focus + label:before {
  457. border-color: darken($color-checkbox-radio-white, 27%);
  458. }
  459. &:not(:disabled):not(:checked) + label:hover:before {
  460. border-color: $color-checkbox-radio-white;
  461. }
  462. &:checked + label:before {
  463. box-shadow: inset 0px 0px 0px 2px var(--color-main-background);
  464. background-color: darken($color-checkbox-radio-white, 14%);
  465. border-color: darken($color-checkbox-radio-white, 14%);
  466. }
  467. &:disabled + label:before {
  468. background-color: darken($color-checkbox-radio-white, 27%) !important; /* override other status */
  469. border-color: rgba($color-checkbox-radio-white, 0.4) !important; /* override other status */
  470. }
  471. &:checked:disabled + label:before {
  472. box-shadow: inset 0px 0px 0px 2px var(--color-main-background);
  473. border-color: rgba($color-checkbox-radio-white, 0.4) !important; /* override other status */
  474. background-color: darken($color-checkbox-radio-white, 27%);
  475. }
  476. }
  477. &.checkbox--white {
  478. &:checked + label:before,
  479. &:indeterminate + label:before {
  480. background-color: transparent !important; /* Override default checked */
  481. border-color: $color-checkbox-radio-white !important; /* Override default checked */
  482. background-image: url('../img/actions/checkbox-mark-white.svg');
  483. }
  484. &:indeterminate + label:before {
  485. background-image: url('../img/actions/checkbox-mixed-white.svg');
  486. }
  487. &:disabled + label:before {
  488. opacity: 0.7; /* No other choice for white background image */
  489. }
  490. }
  491. }
  492. }
  493. /* Select2 overriding. Merged to core with vendor stylesheet */
  494. div.select2-drop {
  495. margin-top: -2px;
  496. background-color: var(--color-main-background);
  497. &.select2-drop-active {
  498. border-color: var(--color-border-dark);
  499. }
  500. .avatar {
  501. display: inline-block;
  502. margin-right: 8px;
  503. vertical-align: middle;
  504. img {
  505. cursor: pointer;
  506. }
  507. }
  508. .select2-search input {
  509. min-height: auto;
  510. background: var(--icon-search-dark) no-repeat right center !important;
  511. background-origin: content-box !important;
  512. }
  513. .select2-results {
  514. max-height: 250px;
  515. margin: 0;
  516. padding: 0;
  517. .select2-result-label {
  518. white-space: nowrap;
  519. overflow: hidden;
  520. text-overflow: ellipsis;
  521. span {
  522. cursor: pointer;
  523. em {
  524. cursor: inherit;
  525. background: unset;
  526. }
  527. }
  528. }
  529. .select2-result,
  530. .select2-no-results,
  531. .select2-searching {
  532. position: relative;
  533. display: list-item;
  534. padding: 12px;
  535. background-color: transparent;
  536. cursor: pointer;
  537. color: var(--color-text-lighter);
  538. }
  539. .select2-result {
  540. &.select2-selected {
  541. background-color: var(--color-background-dark);
  542. }
  543. }
  544. .select2-highlighted {
  545. background-color: var(--color-background-dark);
  546. color: var(--color-main-text);
  547. }
  548. }
  549. }
  550. .select2-chosen,
  551. #select2-drop {
  552. .avatar,
  553. .avatar img {
  554. cursor: pointer;
  555. }
  556. }
  557. div.select2-container-multi {
  558. .select2-choices,
  559. &.select2-container-active .select2-choices {
  560. box-shadow: none;
  561. white-space: nowrap;
  562. text-overflow: ellipsis;
  563. background: var(--color-main-background);
  564. color: var(--color-text-lighter) !important;
  565. box-sizing: content-box;
  566. border-radius: var(--border-radius-large);
  567. border: 2px solid var(--color-border-dark);
  568. margin: 0;
  569. padding: 6px;
  570. min-height: 44px;
  571. &:focus-within {
  572. border-color: var(--color-primary-element)
  573. }
  574. .select2-search-choice {
  575. line-height: 20px;
  576. padding-left: 5px;
  577. &.select2-search-choice-focus,
  578. &:hover,
  579. &:active,
  580. & {
  581. background-image: none;
  582. background-color: var(--color-main-background);
  583. color: var(--color-text-lighter);
  584. border: 1px solid var(--color-border-dark);
  585. }
  586. .select2-search-choice-close {
  587. display: none;
  588. }
  589. }
  590. .select2-search-field input {
  591. line-height: 20px;
  592. min-height: 28px;
  593. max-height: 28px;
  594. color: var(--color-main-text);
  595. &.select2-active {
  596. background: none !important;
  597. }
  598. }
  599. }
  600. }
  601. div.select2-container {
  602. margin: 3px 3px 3px 0;
  603. &.select2-container-multi .select2-choices {
  604. display: flex;
  605. flex-wrap: wrap;
  606. li {
  607. float: none;
  608. }
  609. }
  610. a.select2-choice {
  611. box-shadow: none;
  612. white-space: nowrap;
  613. text-overflow: ellipsis;
  614. background: var(--color-main-background);
  615. color: var(--color-text-lighter) !important;
  616. box-sizing: content-box;
  617. border-radius: var(--border-radius-large);
  618. border: 2px solid var(--color-border-dark);
  619. margin: 0;
  620. padding: 6px 12px;
  621. min-height: 44px;
  622. &:focus-within {
  623. border-color: var(--color-primary-element)
  624. }
  625. .select2-search-choice {
  626. line-height: 20px;
  627. padding-left: 5px;
  628. background-image: none;
  629. background-color: var(--color-background-dark);
  630. border-color: var(--color-background-dark);
  631. .select2-search-choice-close {
  632. display: none;
  633. }
  634. &.select2-search-choice-focus,
  635. &:hover {
  636. background-color: var(--color-border);
  637. border-color: var(--color-border);
  638. }
  639. }
  640. .select2-arrow {
  641. background: none;
  642. border-radius: 0;
  643. border: none;
  644. b {
  645. background: var(--icon-triangle-s-dark) no-repeat center !important;
  646. opacity: .5;
  647. }
  648. }
  649. &:hover .select2-arrow b,
  650. &:focus .select2-arrow b,
  651. &:active .select2-arrow b {
  652. opacity: .7;
  653. }
  654. .select2-search-field input {
  655. line-height: 20px;
  656. }
  657. }
  658. }
  659. /* Vue v-select */
  660. .v-select {
  661. margin: 3px 3px 3px 0;
  662. display: inline-block;
  663. .dropdown-toggle {
  664. display: flex !important;
  665. flex-wrap: wrap;
  666. .selected-tag {
  667. line-height: 20px;
  668. padding-left: 5px;
  669. background-image: none;
  670. background-color: var(--color-main-background);
  671. color: var(--color-text-lighter);
  672. border: 1px solid var(--color-border-dark);
  673. display: inline-flex;
  674. align-items: center;
  675. .close {
  676. margin-left: 3px;
  677. }
  678. }
  679. }
  680. .dropdown-menu {
  681. padding: 0;
  682. li {
  683. padding: 5px;
  684. position: relative;
  685. display: list-item;
  686. background-color: transparent;
  687. cursor: pointer;
  688. color: var(--color-text-lighter);
  689. a {
  690. white-space: nowrap;
  691. overflow: hidden;
  692. text-overflow: ellipsis;
  693. height: 25px;
  694. padding: 3px 7px 4px 2px;
  695. margin: 0;
  696. cursor: pointer;
  697. min-height: 1em;
  698. -webkit-touch-callout: none;
  699. -webkit-user-select: none;
  700. -moz-user-select: none;
  701. -ms-user-select: none;
  702. user-select: none;
  703. display: inline-flex;
  704. align-items: center;
  705. background-color: transparent !important;
  706. color: inherit !important;
  707. &::before {
  708. content: ' ';
  709. background-image: var(--icon-checkmark-dark);
  710. background-repeat: no-repeat;
  711. background-position: center;
  712. min-width: 16px;
  713. min-height: 16px;
  714. display: block;
  715. opacity: 0.5;
  716. margin-right: 5px;
  717. visibility: hidden;
  718. }
  719. }
  720. &.highlight {
  721. color: var(--color-main-text);
  722. }
  723. &.active > a {
  724. background-color: var(--color-background-dark);
  725. color: var(--color-main-text);
  726. &::before {
  727. visibility: visible;
  728. }
  729. }
  730. }
  731. }
  732. }
  733. /* Progressbar */
  734. progress:not(.vue) {
  735. display: block;
  736. width: 100%;
  737. padding: 0;
  738. border: 0 none;
  739. background-color: var(--color-background-dark);
  740. border-radius: var(--border-radius);
  741. flex-basis: 100%;
  742. height: 5px;
  743. overflow: hidden;
  744. &.warn {
  745. &::-moz-progress-bar {
  746. background: var(--color-error);
  747. }
  748. &::-webkit-progress-value {
  749. background: var(--color-error);
  750. }
  751. }
  752. &::-webkit-progress-bar {
  753. background: transparent;
  754. }
  755. &::-moz-progress-bar {
  756. border-radius: var(--border-radius);
  757. background: var(--color-primary-element);
  758. transition: 250ms all ease-in-out;
  759. }
  760. &::-webkit-progress-value {
  761. border-radius: var(--border-radius);
  762. background: var(--color-primary-element);
  763. transition: 250ms all ease-in-out;
  764. }
  765. }
  766. /* Animation */
  767. @keyframes shake {
  768. 10%,
  769. 90% {
  770. transform: translate(-1px);
  771. }
  772. 20%,
  773. 80% {
  774. transform: translate(2px);
  775. }
  776. 30%,
  777. 50%,
  778. 70% {
  779. transform: translate(-4px);
  780. }
  781. 40%,
  782. 60% {
  783. transform: translate(4px);
  784. }
  785. }
  786. .shake {
  787. animation-name: shake;
  788. animation-duration: .7s;
  789. animation-timing-function: ease-out;
  790. }
  791. // Keep the labels for screen readers but hide them since we use placeholders
  792. // Same as .hidden-visually
  793. label.infield {
  794. position: absolute;
  795. left: -10000px;
  796. top: -10000px;
  797. width: 1px;
  798. height: 1px;
  799. overflow: hidden;
  800. }
  801. // when rules are grouped using the comma operator and one selector is invalid / unknown then the whole group is invalidated.
  802. // https://www.w3.org/TR/selectors-3/#grouping
  803. // In this case `::-ms-input-placeholder` is unknown to Firefox and Chrome
  804. @mixin placeholder-style {
  805. color: var(--color-text-maxcontrast);
  806. font-size: var(--default-font-size);
  807. }
  808. ::placeholder {
  809. @include placeholder-style;
  810. }
  811. ::-ms-input-placeholder {
  812. @include placeholder-style;
  813. }
  814. ::-webkit-input-placeholder {
  815. @include placeholder-style;
  816. }