Skip to content

Commit 275c23e

Browse files
authored
Merge pull request #90 from mendix/feat/popup-menu
Add styles for popup menu
2 parents 1a23df7 + 957159f commit 275c23e

File tree

2 files changed

+106
-0
lines changed

2 files changed

+106
-0
lines changed
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
//
2+
// DISCLAIMER:
3+
// Do not change this file because it is core styling.
4+
// Customizing core files will make updating Atlas much more difficult in the future.
5+
// To customize any core styling, copy the part you want to customize to styles/web/sass/app/ so the core styling is overwritten.
6+
//
7+
8+
/* ==========================================================================
9+
Popup Menu
10+
11+
Default Mendix Popup Menus
12+
========================================================================== */
13+
.popupmenu {
14+
position: relative;
15+
display: inline-flex;
16+
}
17+
18+
.popupmenu-trigger {
19+
cursor: pointer;
20+
}
21+
22+
.popupmenu-menu {
23+
position: absolute;
24+
z-index: 999;
25+
display: none;
26+
flex-direction: column;
27+
width: max-content;
28+
border: 1px solid $border-color-default;
29+
border-radius: 8px;
30+
background-color: $bg-color;
31+
box-shadow: 0 3px 14px 2px rgba(0, 0, 0, 0.02), 0 8px 10px 1px rgba(0, 0, 0, 0.04),
32+
0 5px 5px -3px rgba(0, 0, 0, 0.08);
33+
34+
&.popupmenu-position-left {
35+
top: 0;
36+
left: 0;
37+
transform: translateX(-100%);
38+
}
39+
40+
&.popupmenu-position-right {
41+
top: 0;
42+
right: 0;
43+
transform: translateX(100%);
44+
}
45+
46+
&.popupmenu-position-top {
47+
top: 0;
48+
transform: translateY(-100%);
49+
}
50+
51+
&.popupmenu-position-bottom {
52+
bottom: 0;
53+
transform: translateY(100%);
54+
}
55+
56+
.popupmenu-basic-item:first-child,
57+
.popupmenu-custom-item:first-child {
58+
border-top-left-radius: 8px;
59+
border-top-right-radius: 8px;
60+
}
61+
62+
.popupmenu-basic-item:last-child,
63+
.popupmenu-custom-item:last-child {
64+
border-bottom-right-radius: 8px;
65+
border-bottom-left-radius: 8px;
66+
}
67+
}
68+
69+
.popupmenu-basic-divider {
70+
width: 100%;
71+
height: 1px;
72+
background-color: $brand-default;
73+
}
74+
75+
.popupmenu-basic-item {
76+
padding: 12px 16px;
77+
color: $font-color-default;
78+
font-size: 14px;
79+
80+
&:hover,
81+
&:focus,
82+
&:active {
83+
cursor: pointer;
84+
border-color: $bg-color-secondary;
85+
background-color: $bg-color-secondary;
86+
}
87+
88+
&-primary {
89+
color: $brand-default;
90+
}
91+
92+
&-danger {
93+
color: $brand-danger;
94+
}
95+
}
96+
97+
.popupmenu-custom-item {
98+
&:hover,
99+
&:focus,
100+
&:active {
101+
cursor: pointer;
102+
border-color: $bg-color-secondary;
103+
background-color: $bg-color-secondary;
104+
}
105+
}

styles/web/sass/main.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
@import 'core/widgets/navigationlist';
5353
@import 'core/widgets/navigationtree';
5454
@import 'core/helpers/navigationtree';
55+
@import 'core/widgets/popupmenu';
5556
@import 'core/widgets/simplemenubar';
5657
@import 'core/helpers/simplemenubar';
5758
@import 'core/widgets/radiobuttons';

0 commit comments

Comments
 (0)