autocomplete-loading.module.pcss.css

Same filename in this branch
  1. main core/themes/olivero/css/components/autocomplete-loading.module.pcss.css
  2. main core/themes/claro/css/components/autocomplete-loading.module.pcss.css
  3. main core/themes/admin/css/components/autocomplete-loading.module.pcss.css
Same filename and directory in other branches
  1. 10 core/themes/olivero/css/components/autocomplete-loading.module.pcss.css
  2. 10 core/themes/claro/css/components/autocomplete-loading.module.pcss.css
  3. 11.x core/themes/olivero/css/components/autocomplete-loading.module.pcss.css
  4. 11.x core/themes/claro/css/components/autocomplete-loading.module.pcss.css
  5. 9 core/themes/olivero/css/components/autocomplete-loading.module.pcss.css
  6. 9 core/themes/claro/css/components/autocomplete-loading.module.pcss.css
  7. 8.9.x core/themes/claro/css/components/autocomplete-loading.module.pcss.css
  8. 11.x core/themes/admin/css/components/autocomplete-loading.module.pcss.css
  9. 11.x core/themes/default_admin/css/components/autocomplete-loading.module.pcss.css

Visual styles for animated throbber.

See also

autocomplete.js

File

core/themes/default_admin/css/components/autocomplete-loading.module.pcss.css

View source
  1. /**
  2. * @file
  3. * Visual styles for animated throbber.
  4. *
  5. * @see autocomplete.js
  6. */
  7. /**
  8. * Since the autocomplete library is attached conditionally and not globally, we
  9. * can be 99% sure that the default icon will be used. With inline SVGs we can
  10. * prevent a HTTP request and repaint addressing the autocomplete input's
  11. * background — until are sure that it will be pushed by the server with HTTP/2.
  12. *
  13. * The active autocomplete state's background-image is inlined because non-used
  14. * CSS selectors are usually ignored; popular browsers don't download their
  15. * 'url' references.
  16. *
  17. * If these selectors become active, the browser needs some time for painting
  18. * previously ignored remote asset: it should get it from server, parse it and
  19. * repaint the background of autocomplete field. With the inlined background we
  20. * can prevent an additional timeout caused by a new request/response pair.
  21. * Besides this, the autocomplete event itself may easily finish before the
  22. * missing asset gets downloaded/parsed/painted, and the missing instant visual
  23. * feedback would be a usability/accessibility issue as well.
  24. */
  25. .js {
  26. & .form-autocomplete {
  27. margin-inline-end: calc(var(--input-border-size) - 1.5 * var(--input-padding-horizontal));
  28. padding-inline-end: calc(var(--input-padding-horizontal) * 2.5 - var(--input-border-size));
  29. background-image: url(../../images/icons/868686/magnifier.svg);
  30. background-repeat: no-repeat;
  31. background-position: 100% 50%;
  32. &.is-autocompleting {
  33. background-image: url(../../images/icons/003ecc/spinner.svg);
  34. background-position: center right -10px;
  35. }
  36. }
  37. &[dir="rtl"] {
  38. & .form-autocomplete {
  39. background-image: url(../../images/icons/868686/magnifier-rtl.svg);
  40. background-position: 0 50%;
  41. &.is-autocompleting {
  42. background-image: url(../../images/icons/003ecc/spinner-rtl.svg);
  43. background-position: center left 10px;
  44. }
  45. }
  46. }
  47. }
  48. /**
  49. * Autocomplete wrapper for autocomplete message.
  50. */
  51. .claro-autocomplete {
  52. position: relative;
  53. display: inline-block;
  54. max-width: 100%;
  55. }
  56. .claro-autocomplete__message {
  57. position: absolute;
  58. inset-inline-end: 0;
  59. inset-block-end: 100%;
  60. max-width: 100%;
  61. margin-block-end: 0.15rem;
  62. color: var(--color-link);
  63. font-size: var(--font-size-xxs); /* ~11px */
  64. font-weight: bold;
  65. line-height: calc(18rem / 16); /* 18px */
  66. }

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.