1
0

inputs.scss 20 KB

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