1
0

inputs.scss 20 KB

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