-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy path_menu.scss
142 lines (124 loc) · 4.34 KB
/
_menu.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
@use '@justeat/pie-design-tokens/dist/jet' as dt;
@use '../../tools/mixins/type';
@use '../../tools/mixins/truncate';
@use '../../tools/functions/index' as functions;
@use '../../settings/include-media' as *;
@mixin menu() {
/**
* Components > Menu
* =================================
* Used for styling small pieces of information.
*
* Example: Menu – Categories list.
*
* The `c-menu` component is an optional mixin within Fozzie.
* If you'd like to use it in your project you can include it by adding `@include menu();` into your SCSS dependencies file.
*
* Documentation:
* https://fozzie.just-eat.com/styleguide/ui-components/menus
*/
$menu-headerHeight : 57px;
$menu-fontSize : body-l;
$menu-border-color : dt.$color-border-strong;
$menu-border-color--active : dt.$color-border-inverse;
$menu-border-width : 1px;
$menu-border-width--active : 2px;
$menu-link-color : dt.$color-content-default;
$menu-link-padding : functions.spacing() functions.spacing(d);
$menu-positionTop : $menu-headerHeight + functions.spacing(d);
$menu--condensed-link-padding : functions.spacing(a);
.c-menu {
@extend %u-unstyled;
@include type.font-size($menu-fontSize);
}
// Reduces the spacing between menu items
.c-menu--condensed {
.c-menu-link {
padding-bottom: $menu--condensed-link-padding;
padding-top: $menu--condensed-link-padding;
}
}
// Displays the menu horizontally rather than the default of vertically.
.c-menu--horizontal {
display: flex;
.c-menu-item {
border-left: none;
border-bottom: solid $menu-border-width $menu-border-color;
}
.c-menu-link {
padding: functions.spacing();
}
.c-menu-item:active,
.c-menu-item:focus,
.c-menu-item:hover,
.c-menu-item--active {
border-left: none;
border-bottom: solid $menu-border-width--active $menu-border-color--active;
font-weight: dt.$font-weight-regular;
margin-left: 0;
}
}
.c-menu-openBtnWrapper {
display: flex;
justify-content: center;
margin-bottom: functions.spacing(f);
margin-top: -#{functions.spacing(e)};
position: sticky;
top: $menu-positionTop;
transition: 100ms top ease-in-out;
z-index: functions.zIndex(low);
}
.c-menu-openBtn {
@include type.font-size(body-s);
align-items: center;
border-radius: dt.$radius-rounded-d;
display: flex;
padding: functions.spacing() functions.spacing(d);
}
.c-menu-closeBtn {
padding: functions.spacing(d);
position: absolute;
right: 0;
top: 0;
}
.c-menu--spacingTop--aboveMid {
@include media('>=mid') {
margin-top: 170px;
}
}
.c-menu-item {
@include media('>=mid') {
&.has-icon {
display: flex;
align-items: center;
.c-menu-link {
padding-right: functions.spacing(a);
}
}
}
}
.c-menu-link {
@include truncate.truncate();
border-left: solid $menu-border-width $menu-border-color;
display: block;
padding: $menu-link-padding;
text-decoration: none;
&,
&:hover,
&:active,
&:focus {
color: $menu-link-color;
}
&:hover,
&:active,
&:focus,
&.c-menu-link--active {
border-left: solid $menu-border-width--active $menu-border-color--active;
font-weight: dt.$font-weight-bold;
margin-left: -1px;
}
}
.c-menu-icon {
flex-shrink: 0;
}
}