You are here

autocomplete-loading.module.pcss.css in Drupal 10

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 .form-autocomplete {
  26. background-image: url(../../images/icons/868686/magnifier.svg);
  27. background-repeat: no-repeat;
  28. background-position: 100% 50%;
  29. }
  30. .js .form-autocomplete::-ms-clear {
  31. display: none;
  32. }
  33. .js[dir="rtl"] .form-autocomplete {
  34. background-image: url(../../images/icons/868686/magnifier-rtl.svg);
  35. background-position: 0 50%;
  36. }
  37. .js .form-autocomplete.is-autocompleting {
  38. background-image: url(../../images/icons/003ecc/spinner.svg);
  39. }
  40. .js[dir="rtl"] .form-autocomplete.is-autocompleting {
  41. background-image: url(../../images/icons/003ecc/spinner-rtl.svg);
  42. }
  43. /* IE11 does not animate inline SVG. */
  44. /* stylelint-disable-next-line selector-type-no-unknown */
  45. _:-ms-fullscreen,
  46. .js .form-autocomplete.is-autocompleting {
  47. background-image: url("../../images/spinner-ltr.gif");
  48. background-size: 2.5rem 1.25rem;
  49. }
  50. /* stylelint-disable-next-line selector-type-no-unknown */
  51. _:-ms-fullscreen,
  52. .js[dir="rtl"] .form-autocomplete.is-autocompleting {
  53. background-image: url("../../images/spinner-rtl.gif");
  54. }
  55. /**
  56. * Autocomplete wrapper for autocompleting message.
  57. */
  58. .claro-autocomplete {
  59. position: relative;
  60. display: inline-block;
  61. max-width: 100%;
  62. }
  63. .claro-autocomplete__message {
  64. position: absolute;
  65. right: 0;
  66. bottom: 100%;
  67. max-width: 100%;
  68. margin-bottom: 0.15rem;
  69. color: var(--color-link);
  70. font-size: var(--font-size-xxs); /* ~11px */
  71. font-weight: bold;
  72. line-height: calc(18rem / 16); /* 18px */
  73. }
  74. [dir="rtl"] .claro-autocomplete__message {
  75. right: auto;
  76. left: 0;
  77. }