You are here

header-sticky-toggle.css in Drupal 9

Same filename and directory in other branches
  1. 10 core/themes/olivero/css/components/header-sticky-toggle.css

Sticky Header Toggle Button.

This button shows on the left hand side of the header (in LTR layouts), and toggles fixing the header to the top of the viewport.

File

core/themes/olivero/css/components/header-sticky-toggle.css
View source
  1. /*
  2. * DO NOT EDIT THIS FILE.
  3. * See the following change record for more information,
  4. * https://www.drupal.org/node/3084859
  5. * @preserve
  6. */
  7. /**
  8. * @file
  9. * Sticky Header Toggle Button.
  10. *
  11. * This button shows on the left hand side of the header (in LTR layouts), and
  12. * toggles fixing the header to the top of the viewport.
  13. */
  14. .sticky-header-toggle {
  15. display: none
  16. }
  17. @media (min-width: 75rem) {
  18. .sticky-header-toggle {
  19. display: flex;
  20. flex-shrink: 0;
  21. align-items: center;
  22. justify-content: center;
  23. width: 5.625rem;
  24. height: 6.75rem;
  25. pointer-events: none;
  26. opacity: 0;
  27. border: 0;
  28. outline: 0;
  29. background-color: #2494db
  30. }
  31. .sticky-header-toggle:focus {
  32. cursor: pointer;
  33. pointer-events: auto;
  34. opacity: 1;
  35. outline: solid 2px #fff;
  36. outline-offset: -4px;
  37. }
  38. }
  39. @media (min-width: 75rem) {
  40. body:not(.is-always-mobile-nav) .is-fixed .sticky-header-toggle {
  41. visibility: visible
  42. }
  43. }
  44. @media (min-width: 75rem) {
  45. body.is-always-mobile-nav .sticky-header-toggle {
  46. visibility: hidden
  47. }
  48. }
  49. .sticky-header-toggle__icon {
  50. position: relative;
  51. width: 2.25rem;
  52. height: 1.3125rem;
  53. transition: opacity 0.2s;
  54. pointer-events: none;
  55. transform-style: preserve-3d
  56. }
  57. .sticky-header-toggle__icon > span {
  58. display: block;
  59. height: 0;
  60. /* Intentionally not using CSS logical properties. */
  61. border-top: solid 3px #fff
  62. }
  63. [dir="ltr"] .sticky-header-toggle__icon > span:nth-child(1) {
  64. left: 0
  65. }
  66. [dir="rtl"] .sticky-header-toggle__icon > span:nth-child(1) {
  67. right: 0
  68. }
  69. .sticky-header-toggle__icon > span:nth-child(1) {
  70. position: absolute;
  71. top: 0;
  72. width: 100%;
  73. height: 0;
  74. transition: transform 0.2s;
  75. background-color: #fff;
  76. }
  77. [dir="ltr"] .sticky-header-toggle__icon > span:nth-child(2) {
  78. left: 0
  79. }
  80. [dir="rtl"] .sticky-header-toggle__icon > span:nth-child(2) {
  81. right: 0
  82. }
  83. .sticky-header-toggle__icon > span:nth-child(2) {
  84. position: absolute;
  85. top: 0.5625rem;
  86. width: 100%;
  87. height: 0;
  88. transition: opacity 0.2s;
  89. background-color: #fff;
  90. }
  91. [dir="ltr"] .sticky-header-toggle__icon > span:nth-child(3) {
  92. left: 0
  93. }
  94. [dir="rtl"] .sticky-header-toggle__icon > span:nth-child(3) {
  95. right: 0
  96. }
  97. .sticky-header-toggle__icon > span:nth-child(3) {
  98. position: absolute;
  99. top: auto;
  100. bottom: 0;
  101. width: 100%;
  102. height: 0;
  103. transition: transform 0.2s;
  104. background-color: #fff;
  105. }
  106. .is-fixed .sticky-header-toggle {
  107. cursor: pointer;
  108. pointer-events: auto;
  109. opacity: 1;
  110. }
  111. [aria-checked="true"] .sticky-header-toggle__icon > span:nth-child(1) {
  112. top: 0.5625rem;
  113. transform: rotate(-45deg);
  114. }
  115. [aria-checked="true"] .sticky-header-toggle__icon > span:nth-child(2) {
  116. opacity: 0;
  117. }
  118. [aria-checked="true"] .sticky-header-toggle__icon > span:nth-child(3) {
  119. top: 0.5625rem;
  120. transform: rotate(45deg);
  121. }