Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x

nav-button-mobile.pcss.css

Nav Button Mobile.

File

core/themes/olivero/css/components/navigation/nav-button-mobile.pcss.css

View source
  1. /**
  2. * @file
  3. * Nav Button Mobile.
  4. */
  5. @import "../../base/media-queries.pcss.css";
  6. .mobile-nav-button {
  7. position: relative;
  8. z-index: 505; /* Appear above mobile nav. */
  9. display: flex;
  10. align-items: center;
  11. align-self: center;
  12. width: var(--sp2);
  13. height: var(--sp2);
  14. margin-inline-start: auto;
  15. margin-inline-end: -6px;
  16. padding-block: 0;
  17. padding-inline-start: 6px;
  18. padding-inline-end: 6px;
  19. cursor: pointer;
  20. border: none;
  21. background: transparent;
  22. appearance: none;
  23. &:focus {
  24. outline: solid 2px var(--color--primary-40);
  25. }
  26. &:active {
  27. color: inherit; /* Override Safari's default UA styles. */
  28. }
  29. @media (--sm) {
  30. display: inline-flex;
  31. width: auto;
  32. padding-inline-start: var(--sp);
  33. }
  34. }
  35. /* Text that says "menu". */
  36. .mobile-nav-button__label {
  37. position: absolute;
  38. display: block;
  39. overflow: hidden;
  40. clip: rect(1px, 1px, 1px, 1px);
  41. width: 1px;
  42. height: 1px;
  43. word-wrap: normal;
  44. @media (--sm) {
  45. position: static;
  46. overflow: visible;
  47. clip: auto;
  48. width: auto;
  49. height: auto;
  50. margin-inline-end: 12px;
  51. letter-spacing: 0.05em;
  52. font-size: 14px;
  53. font-weight: 600;
  54. }
  55. }
  56. .mobile-nav-button__icon {
  57. position: relative;
  58. display: block;
  59. width: var(--sp2);
  60. height: 0;
  61. border-top: solid 3px var(--color--primary-50);
  62. &::before,
  63. &::after {
  64. position: absolute;
  65. inset-block-start: 0;
  66. inset-inline-start: 0;
  67. width: 100%;
  68. height: 0;
  69. content: "";
  70. transition: transform 0.2s;
  71. border-top: solid 3px var(--color--primary-50);
  72. }
  73. &::before {
  74. transform: translateY(-11px);
  75. }
  76. &::after {
  77. transform: translateY(5px);
  78. }
  79. }
  80. .mobile-nav-button[aria-expanded="true"] .mobile-nav-button__icon {
  81. border-top-color: transparent;
  82. &::before {
  83. transform: translateY(-3px) rotate(-45deg);
  84. }
  85. &::after {
  86. transform: translateY(-3px) rotate(45deg);
  87. }
  88. }
RSS feed
Powered by Drupal