autocomplete-loading.module.pcss.css

Same filename in this branch
  1. 9 core/themes/olivero/css/components/autocomplete-loading.module.pcss.css
Same filename and directory in other branches
  1. 8.9.x core/themes/claro/css/components/autocomplete-loading.module.pcss.css
  2. 10 core/themes/olivero/css/components/autocomplete-loading.module.pcss.css
  3. 10 core/themes/claro/css/components/autocomplete-loading.module.pcss.css
  4. 11.x core/themes/olivero/css/components/autocomplete-loading.module.pcss.css
  5. 11.x 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. @import "../base/variables.pcss.css";
  8. /**
  9. * Since the autocomplete library is attached conditionally and not globally,
  10. * we can be 99% sure that the default icon will be used.
  11. * With inline SVGs we can prevent a HTTP request and repaint addressing the
  12. * autocomplete input's background — until are sure that it will be pushed by
  13. * the server with HTTP/2.
  14. *
  15. * The autocompleting (active) state's background-image is inlined because
  16. * non-used CSS selectors are usually ignored; popular browsers don't download
  17. * their 'url' references.
  18. * If these selectors become active, the browser needs some time for painting
  19. * previously ignored remote asset: it should get it from server, parse it and
  20. * repaint the background of autocomplete field. With the inlined background we
  21. * can prevent an additional timeout caused by a new request/response pair.
  22. * Besides this, the autocompleting event itself may easily finish before the
  23. * missing asset gets downloaded/parsed/painted, and the missing instant visual
  24. * feedback would be a usability/accessibility issue as well.
  25. */
  26. .js .form-autocomplete {
  27. background-image: url(../../images/icons/868686/magnifier.svg);
  28. background-repeat: no-repeat;
  29. background-position: 100% 50%;
  30. }
  31. .js .form-autocomplete::-ms-clear {
  32. display: none;
  33. }
  34. .js[dir="rtl"] .form-autocomplete {
  35. background-image: url(../../images/icons/868686/magnifier-rtl.svg);
  36. background-position: 0 50%;
  37. }
  38. .js .form-autocomplete.is-autocompleting {
  39. background-image: url(../../images/icons/003ecc/spinner.svg);
  40. background-position: center right -10px;
  41. }
  42. .js[dir="rtl"] .form-autocomplete.is-autocompleting {
  43. background-image: url(../../images/icons/003ecc/spinner-rtl.svg);
  44. background-position: center left 10px;
  45. }
  46. /* IE11 does not animate inline SVG. */
  47. /* stylelint-disable-next-line selector-type-no-unknown */
  48. _:-ms-fullscreen,
  49. .js .form-autocomplete.is-autocompleting {
  50. background-image: url("../../images/spinner-ltr.gif");
  51. background-size: 2.5rem 1.25rem;
  52. }
  53. /* stylelint-disable-next-line selector-type-no-unknown */
  54. _:-ms-fullscreen,
  55. .js[dir="rtl"] .form-autocomplete.is-autocompleting {
  56. background-image: url("../../images/spinner-rtl.gif");
  57. }
  58. /**
  59. * Autocomplete wrapper for autocompleting message.
  60. */
  61. .claro-autocomplete {
  62. position: relative;
  63. display: inline-block;
  64. max-width: 100%;
  65. }
  66. .claro-autocomplete__message {
  67. position: absolute;
  68. right: 0;
  69. bottom: 100%;
  70. max-width: 100%;
  71. margin-bottom: 0.15rem;
  72. color: var(--color-link);
  73. font-size: var(--font-size-xxs); /* ~11px */
  74. font-weight: bold;
  75. line-height: calc(18rem / 16); /* 18px */
  76. }
  77. [dir="rtl"] .claro-autocomplete__message {
  78. right: auto;
  79. left: 0;
  80. }

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