summaryrefslogtreecommitdiff
path: root/addons/web/static/src/scss/navbar.scss
blob: b4c1872e7ce464ad3e64cd95c5e5b76bc11100cf (plain)
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
body.o_is_superuser .o_menu_systray {
    background: repeating-linear-gradient(
        135deg,
        #d9b904, #d9b904 10px,
        #373435 10px, #373435 20px
    );
    border-bottom-left-radius: 20px;

    > li {
        > a, > label {
            &:hover {
                background-color: fade_out($o-navbar-inverse-link-hover-bg, 0.5);
            }
        }
    }

    .show .dropdown-toggle {
        background-color: fade_out($o-navbar-inverse-link-hover-bg, 0.5);
    }
}
.o_main_navbar {
    position: relative;
    height: $o-navbar-height;
    border-bottom: 1px solid $o-navbar-inverse-link-hover-bg;
    background-color: $o-brand-odoo;
    color: white;

    > a, > button {
        float: left;
        height: $o-navbar-height;
        border: none;
        padding: 0 $o-horizontal-padding - 4px 0 $o-horizontal-padding;
        line-height: $o-navbar-height;
        background-color: transparent;
        text-align: center;
        color: inherit;

        font-size: 18px;
        user-select: none;

        &:hover, &:focus {
            background-color: $o-navbar-inverse-link-hover-bg;
            color: inherit;
        }
        &:focus, &:active, &:focus:active {
            outline: none;
        }
    }

    .o_app {
        cursor: pointer;
    }

    > .o_menu_brand {
        display: block;
        float: left;
        margin-right: 35px;
        user-select: none;
        color: white;
        font-size: 22px;
        font-weight: 500;
        line-height: $o-navbar-height;
        cursor: pointer;
    }

    > .o_menu_toggle {
        margin-right: 5px;
    }

    > ul {
        display: block;
        float: left;
        margin: 0;
        padding: 0;
        list-style: none;

        > li {
            position: relative;
            display: block;
            float: left;

            > a {
                display: block;

                &:focus, &:active, &:focus:active {
                    outline: none;
                }
                &, &:hover, &:focus {
                    text-decoration: none;
                }
            }

            > a, > label {
                height: $o-navbar-height;
                padding: 0 10px;
                color: white;
                line-height: $o-navbar-height;

                &:hover {
                    background-color: $o-navbar-inverse-link-hover-bg;
                }
            }

            &.o_extra_menu_items {
                > a {
                    width: $o-navbar-height;
                    text-align: center;
                }
                &.show > ul {
                    padding: 0;

                    > li {
                        > a {
                            background-color: $o-brand-odoo;
                            color: white;
                            border-bottom: 1px solid $o-brand-lightsecondary;

                            &.dropdown-toggle {
                                background-color: lighten($o-brand-odoo, 15%);
                                pointer-events: none; // hack to prevent clicking on it because dropdown always opened
                            }
                        }
                        > .dropdown-menu { // remove dropdown-menu default style as it is nested in another one
                            position: static;
                            float: none;
                            display: block;
                            border: none;
                            box-shadow: none;
                            max-height: none;
                        }
                    }
                }
            }
        }

        &.o_menu_systray {
            float: right;
        }
    }

    .dropdown-menu.show {
        max-height: 90vh; // the dropdown should not overstep the viewport
        min-width: 100%;
        overflow: auto;
        margin-top: 0;

        @for $index from 3 through 5 {
            .o_menu_header_lvl_#{$index}, .o_menu_entry_lvl_#{$index} {
                padding-left: $o-dropdown-hpadding + ($index - 2)*12px;
            }
        }
    }

    .show .dropdown-toggle {
        background-color: $o-navbar-inverse-link-hover-bg;
    }
    .o_user_menu {
        margin-left: 6px;

        > a {
            padding-right: $o-horizontal-padding;
        }

        .oe_topbar_avatar {
            height: 26px;
            width: 26px;
            object-fit: cover;
            transform: translateY(-2px);
        }
    }
}