nav-secondary.pcss.css

Secondary navigation styling.

File

core/themes/olivero/css/components/navigation/nav-secondary.pcss.css

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

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