nav-secondary.css

Same filename and directory in other branches
  1. 10 core/themes/olivero/css/components/navigation/nav-secondary.css
  2. 9 core/themes/olivero/css/components/navigation/nav-secondary.css
  3. main core/themes/olivero/css/components/navigation/nav-secondary.css

Secondary navigation styling.

File

core/themes/olivero/css/components/navigation/nav-secondary.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. * Secondary navigation styling.
  10. */
  11. .secondary-nav {
  12. letter-spacing: 0.02em;
  13. font-size: var(--font-size-s);
  14. font-weight: 600;
  15. }
  16. .secondary-nav__menu {
  17. display: flex;
  18. align-items: center;
  19. margin-block: 0;
  20. margin-inline-start: 0;
  21. margin-inline-end: 0;
  22. padding-block: 0;
  23. padding-inline-start: 0;
  24. padding-inline-end: 0;
  25. list-style: none;
  26. }
  27. .secondary-nav__menu-item {
  28. /* Parent element is set to flex-basis: 0. We
  29. * don't want text to wrap unless it goes over a
  30. * certain arbitrary width.
  31. */
  32. /* @todo should this be scoped to desktop nav? */
  33. width: max-content;
  34. max-width: 12.5rem;
  35. &:not(:last-child) {
  36. margin-inline-end: var(--sp1-5);
  37. }
  38. }
  39. .secondary-nav__menu-link {
  40. position: relative;
  41. display: inline-flex;
  42. align-items: center;
  43. -webkit-text-decoration: none;
  44. text-decoration: none;
  45. color: inherit;
  46. &::after {
  47. position: absolute;
  48. bottom: 0;
  49. left: 0;
  50. width: 100%;
  51. height: 0;
  52. content: "";
  53. transition:
  54. opacity 0.2s,
  55. transform 0.2s;
  56. transform: translateY(0.3125rem);
  57. opacity: 0;
  58. /* Intentionally not using CSS logical properties. */
  59. border-top: solid 2px currentColor;
  60. }
  61. &:hover {
  62. &::after {
  63. transform: translateY(0);
  64. opacity: 0.8;
  65. }
  66. }
  67. }
  68. body:not(.is-always-mobile-nav) {
  69. @media (min-width: 75rem) {
  70. & .secondary-nav {
  71. position: relative;
  72. display: flex;
  73. margin-inline-start: var(--sp);
  74. padding-inline-start: var(--sp2);
  75. &::before {
  76. position: absolute;
  77. inset-block-start: 50%;
  78. inset-inline-start: 0;
  79. width: 2px;
  80. height: var(--sp2);
  81. content: "";
  82. transform: translateY(-50%);
  83. background-color: var(--color--gray-90);
  84. }
  85. }
  86. & .secondary-nav__menu-item:not(:last-child) {
  87. margin-inline-end: var(--sp2);
  88. }
  89. & .secondary-nav__menu-link {
  90. &:focus {
  91. position: relative;
  92. outline: 0;
  93. padding-block: var(--sp0-5);
  94. &::before {
  95. position: absolute;
  96. top: 50%;
  97. left: 50%;
  98. width: calc(100% + var(--sp));
  99. height: 100%;
  100. content: "";
  101. transform: translate(-50%, -50%);
  102. border: solid 2px var(--color--primary-50);
  103. border-radius: 0.25rem;
  104. }
  105. }
  106. }
  107. }
  108. }

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