inputs.scss 20 KB

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