inputs.scss 20 KB

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