autocomplete-loading.module.pcss.css

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

Visual styles for animated throbber.

See also

autocomplete.js

File

core/themes/claro/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,
  9. * we can be 99% sure that the default icon will be used.
  10. * With inline SVGs we can prevent a HTTP request and repaint addressing the
  11. * autocomplete input's background — until are sure that it will be pushed by
  12. * the server with HTTP/2.
  13. *
  14. * The autocompleting (active) state's background-image is inlined because
  15. * non-used CSS selectors are usually ignored; popular browsers don't download
  16. * their 'url' references.
  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 autocompleting 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. background-image: url(../../images/icons/868686/magnifier.svg);
  28. background-repeat: no-repeat;
  29. background-position: 100% 50%;
  30. &.is-autocompleting {
  31. background-image: url(../../images/icons/003ecc/spinner.svg);
  32. background-position: center right -10px;
  33. }
  34. }
  35. &[dir="rtl"] {
  36. & .form-autocomplete {
  37. background-image: url(../../images/icons/868686/magnifier-rtl.svg);
  38. background-position: 0 50%;
  39. &.is-autocompleting {
  40. background-image: url(../../images/icons/003ecc/spinner-rtl.svg);
  41. background-position: center left 10px;
  42. }
  43. }
  44. }
  45. }
  46. /**
  47. * Autocomplete wrapper for autocompleting message.
  48. */
  49. .claro-autocomplete {
  50. position: relative;
  51. display: inline-block;
  52. max-width: 100%;
  53. }
  54. .claro-autocomplete__message {
  55. position: absolute;
  56. inset-inline-end: 0;
  57. inset-block-end: 100%;
  58. max-width: 100%;
  59. margin-block-end: 0.15rem;
  60. color: var(--color-link);
  61. font-size: var(--font-size-xxs); /* ~11px */
  62. font-weight: bold;
  63. line-height: calc(18rem / 16); /* 18px */
  64. }

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