header.css

Same filename in this branch
  1. 10 core/profiles/demo_umami/themes/umami/css/components/regions/header/header.css
Same filename in other branches
  1. 9 core/profiles/demo_umami/themes/umami/css/components/regions/header/header.css
  2. 9 core/themes/bartik/css/components/header.css
  3. 8.9.x core/profiles/demo_umami/themes/umami/css/components/regions/header/header.css
  4. 8.9.x core/themes/bartik/css/components/header.css
  5. 11.x core/profiles/demo_umami/themes/umami/components/header/header.css
  6. 11.x core/profiles/demo_umami/themes/umami/css/components/regions/header/header.css
.umami-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 4%;
}

/* Medium */
@media screen and (min-width: 48rem) {
  /* 768px */
  .umami-header {
    padding-top: 0;
  }
}

/* Extra large + side margins */
@media screen and (min-width: 80rem) {
  /* 1200px (large) + 80px (side margins) = 1280px */
  .umami-header {
    padding: 0;
  }
}

.umami-header__burger {
  width: 41px;
  height: 41px;
  margin-right: -9px;
  /* the padding, margin & transparent border means the hamburger doesn't move on focus/hover */
  padding: 0 6px;
  text-align: left;
  border: 3px solid transparent;
  border-radius: 0;
  background-color: transparent;
  line-height: 1;
}

.umami-header__burger:hover {
  background-color: transparent;
}

.umami-header__burger svg {
  display: block;
}

@media screen and (min-width: 48em) {
  .umami-header__burger {
    display: none;
  }
}

.umami-header__dropdown {
  overflow: hidden;
  flex-basis: 100%;
  max-height: 0;
  transition: max-height 0.5s ease-in;
}

@media screen and (min-width: 48em) {
  .umami-header__dropdown {
    overflow: auto;
    flex-basis: auto;
    max-height: none;
  }
}

.umami-header__burger[aria-expanded="true"] ~ .umami-header__dropdown {
  overflow-y: auto;
  /**
   * An exact max-height value must be set to make possible to animate the menu display.
   * It my not be much larger than the content because that would break the animation.
   * See: https://css-tricks.com/using-css-transitions-auto-dimensions/
   */
  max-height: 18.75rem;
}

.umami-header__logo {
  flex: 0 1 40%;
}

@media screen and (min-width: 48em) {
  .umami-header__logo {
    flex: 0 1 220px;
    margin: 2.5rem 0;
  }
}

File

core/profiles/demo_umami/themes/umami/components/header/header.css

View source
  1. .umami-header {
  2. display: flex;
  3. flex-wrap: wrap;
  4. align-items: center;
  5. justify-content: space-between;
  6. padding: 0.75rem 4%;
  7. }
  8. /* Medium */
  9. @media screen and (min-width: 48rem) {
  10. /* 768px */
  11. .umami-header {
  12. padding-top: 0;
  13. }
  14. }
  15. /* Extra large + side margins */
  16. @media screen and (min-width: 80rem) {
  17. /* 1200px (large) + 80px (side margins) = 1280px */
  18. .umami-header {
  19. padding: 0;
  20. }
  21. }
  22. .umami-header__burger {
  23. width: 41px;
  24. height: 41px;
  25. margin-right: -9px;
  26. /* the padding, margin & transparent border means the hamburger doesn't move on focus/hover */
  27. padding: 0 6px;
  28. text-align: left;
  29. border: 3px solid transparent;
  30. border-radius: 0;
  31. background-color: transparent;
  32. line-height: 1;
  33. }
  34. .umami-header__burger:hover {
  35. background-color: transparent;
  36. }
  37. .umami-header__burger svg {
  38. display: block;
  39. }
  40. @media screen and (min-width: 48em) {
  41. .umami-header__burger {
  42. display: none;
  43. }
  44. }
  45. .umami-header__dropdown {
  46. overflow: hidden;
  47. flex-basis: 100%;
  48. max-height: 0;
  49. transition: max-height 0.5s ease-in;
  50. }
  51. @media screen and (min-width: 48em) {
  52. .umami-header__dropdown {
  53. overflow: auto;
  54. flex-basis: auto;
  55. max-height: none;
  56. }
  57. }
  58. .umami-header__burger[aria-expanded="true"] ~ .umami-header__dropdown {
  59. overflow-y: auto;
  60. /**
  61. * An exact max-height value must be set to make possible to animate the menu display.
  62. * It my not be much larger than the content because that would break the animation.
  63. * See: https://css-tricks.com/using-css-transitions-auto-dimensions/
  64. */
  65. max-height: 18.75rem;
  66. }
  67. .umami-header__logo {
  68. flex: 0 1 40%;
  69. }
  70. @media screen and (min-width: 48em) {
  71. .umami-header__logo {
  72. flex: 0 1 220px;
  73. margin: 2.5rem 0;
  74. }
  75. }

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