You are here

header-sticky-toggle.css in Drupal 10

Same filename and directory in other branches
  1. 9 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. /*
  15. * Media query breakpoints.
  16. * Processed by postcss/postcss-custom-media.
  17. */
  18. /* Navigation related breakpoints */
  19. /* Grid related breakpoints */
  20. /* Grid shifts from 6 to 14 columns. */
  21. /* Width of the entire grid maxes out. */
  22. .sticky-header-toggle {
  23. display: none
  24. }
  25. @media (min-width: 75rem) {
  26. .sticky-header-toggle {
  27. display: flex;
  28. flex-shrink: 0;
  29. align-items: center;
  30. justify-content: center;
  31. width: var(--content-left);
  32. height: var(--sp6);
  33. pointer-events: none;
  34. opacity: 0;
  35. border: 0;
  36. outline: 0;
  37. background-color: var(--color--primary-50)
  38. }
  39. .sticky-header-toggle:focus {
  40. cursor: pointer;
  41. pointer-events: auto;
  42. opacity: 1;
  43. outline: solid 2px var(--color--white);
  44. outline-offset: -4px;
  45. }
  46. }
  47. @media (min-width: 75rem) {
  48. body:not(.is-always-mobile-nav) .is-fixed .sticky-header-toggle {
  49. visibility: visible
  50. }
  51. }
  52. @media (min-width: 75rem) {
  53. body.is-always-mobile-nav .sticky-header-toggle {
  54. visibility: hidden
  55. }
  56. }
  57. .sticky-header-toggle__icon {
  58. position: relative;
  59. width: var(--sp2);
  60. height: 1.3125rem;
  61. transition: opacity 0.2s;
  62. pointer-events: none;
  63. transform-style: preserve-3d
  64. }
  65. .sticky-header-toggle__icon > span {
  66. display: block;
  67. height: 0;
  68. /* Intentionally not using CSS logical properties. */
  69. border-top: solid 3px var(--color--white)
  70. }
  71. [dir="ltr"] .sticky-header-toggle__icon > span:nth-child(1) {
  72. left: 0
  73. }
  74. [dir="rtl"] .sticky-header-toggle__icon > span:nth-child(1) {
  75. right: 0
  76. }
  77. .sticky-header-toggle__icon > span:nth-child(1) {
  78. position: absolute;
  79. top: 0;
  80. width: 100%;
  81. height: 0;
  82. transition: transform 0.2s;
  83. background-color: var(--color--white);
  84. }
  85. [dir="ltr"] .sticky-header-toggle__icon > span:nth-child(2) {
  86. left: 0
  87. }
  88. [dir="rtl"] .sticky-header-toggle__icon > span:nth-child(2) {
  89. right: 0
  90. }
  91. .sticky-header-toggle__icon > span:nth-child(2) {
  92. position: absolute;
  93. top: 0.5625rem;
  94. width: 100%;
  95. height: 0;
  96. transition: opacity 0.2s;
  97. background-color: var(--color--white);
  98. }
  99. [dir="ltr"] .sticky-header-toggle__icon > span:nth-child(3) {
  100. left: 0
  101. }
  102. [dir="rtl"] .sticky-header-toggle__icon > span:nth-child(3) {
  103. right: 0
  104. }
  105. .sticky-header-toggle__icon > span:nth-child(3) {
  106. position: absolute;
  107. top: auto;
  108. bottom: 0;
  109. width: 100%;
  110. height: 0;
  111. transition: transform 0.2s;
  112. background-color: var(--color--white);
  113. }
  114. .is-fixed .sticky-header-toggle {
  115. cursor: pointer;
  116. pointer-events: auto;
  117. opacity: 1;
  118. }
  119. [aria-checked="true"] .sticky-header-toggle__icon > span:nth-child(1) {
  120. top: 0.5625rem;
  121. transform: rotate(-45deg);
  122. }
  123. [aria-checked="true"] .sticky-header-toggle__icon > span:nth-child(2) {
  124. opacity: 0;
  125. }
  126. [aria-checked="true"] .sticky-header-toggle__icon > span:nth-child(3) {
  127. top: 0.5625rem;
  128. transform: rotate(45deg);
  129. }