_base.scss 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. // Hamburger
  2. // ==================================================
  3. .hamburger {
  4. padding: $hamburger-padding-y $hamburger-padding-x;
  5. display: inline-block;
  6. cursor: pointer;
  7. transition-property: opacity, filter;
  8. transition-duration: 0.15s;
  9. transition-timing-function: linear;
  10. // Normalize (<button>)
  11. font: inherit;
  12. color: inherit;
  13. text-transform: none;
  14. background-color: transparent;
  15. border: 0;
  16. margin: 0;
  17. overflow: visible;
  18. &:hover {
  19. @if $hamburger-hover-use-filter == true {
  20. filter: $hamburger-hover-filter;
  21. }
  22. @else {
  23. opacity: $hamburger-hover-opacity;
  24. }
  25. }
  26. &.is-active {
  27. &:hover {
  28. @if $hamburger-hover-use-filter == true {
  29. filter: $hamburger-active-hover-filter;
  30. }
  31. @else {
  32. opacity: $hamburger-active-hover-opacity;
  33. }
  34. }
  35. .hamburger-inner,
  36. .hamburger-inner::before,
  37. .hamburger-inner::after {
  38. background-color: $hamburger-active-layer-color;
  39. }
  40. }
  41. }
  42. .hamburger-box {
  43. width: $hamburger-layer-width;
  44. height: $hamburger-layer-height * 3 + $hamburger-layer-spacing * 2;
  45. display: inline-block;
  46. position: relative;
  47. }
  48. .hamburger-inner {
  49. display: block;
  50. top: 50%;
  51. margin-top: $hamburger-layer-height / -2;
  52. &,
  53. &::before,
  54. &::after {
  55. width: $hamburger-layer-width;
  56. height: $hamburger-layer-height;
  57. background-color: $hamburger-layer-color;
  58. border-radius: $hamburger-layer-border-radius;
  59. position: absolute;
  60. transition-property: transform;
  61. transition-duration: 0.15s;
  62. transition-timing-function: ease;
  63. }
  64. &::before,
  65. &::after {
  66. content: "";
  67. display: block;
  68. }
  69. &::before {
  70. top: ($hamburger-layer-spacing + $hamburger-layer-height) * -1;
  71. }
  72. &::after {
  73. bottom: ($hamburger-layer-spacing + $hamburger-layer-height) * -1;
  74. }
  75. }