_layout-header.scss 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. .site-header {
  2. position: fixed;
  3. top:0;
  4. left:0;
  5. width:100%;
  6. height:60px;
  7. display: flex;
  8. align-items: center;
  9. background-color:$header-color;
  10. border-bottom:2px solid $theme-color;
  11. padding-left:20px;
  12. font-weight: 600;
  13. }
  14. .site-title {
  15. @include relative-font-size(1.625);
  16. letter-spacing: -1px;
  17. margin-bottom: 0;
  18. float: left;
  19. &:hover {
  20. text-decoration: none;
  21. }
  22. @include media-query($on-mobile) {
  23. padding-right: 45px;
  24. }
  25. }
  26. .site-icon {
  27. position: absolute;
  28. left: 50%;
  29. top: 100%;
  30. margin-top: -47px;
  31. width: 70px;
  32. height: 70px;
  33. padding: 14px;
  34. background: $content-color;
  35. border-radius: 50%;
  36. @include media-query($on-mobile) {
  37. width: 50px;
  38. height: 50px;
  39. margin-top: -25px;
  40. }
  41. }
  42. .site-nav {
  43. position: absolute;
  44. top: 9px;
  45. right: $spacing-unit / 2;
  46. border-radius: 5px;
  47. text-align: right;
  48. .nav-trigger {
  49. display: none;
  50. }
  51. .menu-icon {
  52. float: right;
  53. width: 36px;
  54. height: 26px;
  55. line-height: 0;
  56. padding-top: 10px;
  57. text-align: center;
  58. > svg path {
  59. fill: $theme-color;
  60. }
  61. }
  62. label[for="nav-trigger"] {
  63. display: block;
  64. float: right;
  65. width: 36px;
  66. height: 36px;
  67. z-index: 2;
  68. cursor: pointer;
  69. }
  70. input ~ .trigger {
  71. clear: both;
  72. display: none;
  73. }
  74. input:checked ~ .trigger {
  75. display: block;
  76. background:$header-color;
  77. border-radius:20px;
  78. padding:10px;
  79. }
  80. .page-link {
  81. display: block;
  82. padding: 5px 10px;
  83. // Gaps between nav items, but not on the last one
  84. &:not(:last-child) {
  85. margin-right: 0;
  86. }
  87. &:hover {
  88. text-decoration: none;
  89. }
  90. }
  91. @media screen and (min-width: $on-laptop) {
  92. flex:1;
  93. position: static;
  94. float: right;
  95. border: none;
  96. background-color: inherit;
  97. height:100%;
  98. label[for="nav-trigger"] {
  99. display: none;
  100. }
  101. .menu-icon {
  102. display: none;
  103. }
  104. input ~ .trigger {
  105. display: block;
  106. height:100%;
  107. }
  108. .page-link {
  109. display: inline-flex;
  110. align-items:center;
  111. height:100%;
  112. &.active {
  113. background-color:$theme-color;
  114. color:$header-color;
  115. }
  116. }
  117. }
  118. }