Skip to content

Commit 9c51f6c

Browse files
authored
Merge pull request #72 from mendix/tabcontainer-badge
Feat: Including styles for tabcontainer badge
2 parents b2ffb69 + 6667f15 commit 9c51f6c

File tree

8 files changed

+53
-6
lines changed

8 files changed

+53
-6
lines changed

styles/native/js/core/widgets/badge.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ To customize any core styling, copy the part you want to customize to styles/nat
1414
export const com_mendix_widget_native_badge_Badge = {
1515
container: {
1616
// All ViewStyle properties are allowed
17+
borderRadius: badge.borderRadius,
1718
backgroundColor: badge.default.backgroundColor,
1819
paddingVertical: badge.paddingVertical,
1920
paddingHorizontal: badge.paddingHorizontal,

styles/native/js/core/widgets/tabcontainer.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { font, spacing, tabContainer } from "../variables";
1+
import { badge, font, spacing, tabContainer } from "../variables";
22
/*
33
44
DISCLAIMER:
@@ -48,4 +48,20 @@ export const TabContainer = {
4848
fontWeight: tabContainer.activeLabel.fontWeight,
4949
textTransform: tabContainer.activeLabel.textTransform,
5050
},
51+
badgeContainer: {
52+
// All ViewStyle properties are allowed
53+
borderRadius: badge.borderRadius,
54+
backgroundColor: badge.default.backgroundColor,
55+
paddingVertical: badge.paddingVertical,
56+
paddingHorizontal: badge.paddingHorizontal,
57+
marginLeft: 8
58+
},
59+
badgeCaption: {
60+
// All TextStyle properties are allowed
61+
fontSize: font.size,
62+
color: badge.default.color,
63+
fontFamily: font.family,
64+
fontWeight: badge.fontWeight,
65+
marginTop: -1,
66+
}
5167
};

styles/native/ts/core/widgets/badge.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ To customize any core styling, copy the part you want to customize to styles/nat
1515
export const com_mendix_widget_native_badge_Badge: BadgeType = {
1616
container: {
1717
// All ViewStyle properties are allowed
18+
borderRadius: badge.borderRadius,
1819
backgroundColor: badge.default.backgroundColor,
1920
paddingVertical: badge.paddingVertical,
2021
paddingHorizontal: badge.paddingHorizontal,

styles/native/ts/core/widgets/tabcontainer.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { font, spacing, tabContainer } from "../variables";
2-
import { TabContainerType } from "../../types/widgets";
1+
import { badge, font, spacing, tabContainer } from "../variables";
2+
import { TabContainerType } from "../../types/widgets";
33
/*
44
55
DISCLAIMER:
@@ -49,4 +49,20 @@ export const TabContainer: TabContainerType = {
4949
fontWeight: tabContainer.activeLabel.fontWeight,
5050
textTransform: tabContainer.activeLabel.textTransform,
5151
},
52+
badgeContainer: {
53+
// All ViewStyle properties are allowed
54+
borderRadius: badge.borderRadius,
55+
backgroundColor: badge.default.backgroundColor,
56+
paddingVertical: badge.paddingVertical,
57+
paddingHorizontal: badge.paddingHorizontal,
58+
marginLeft: 8
59+
},
60+
badgeCaption: {
61+
// All TextStyle properties are allowed
62+
fontSize: font.size,
63+
color: badge.default.color,
64+
fontFamily: font.family,
65+
fontWeight: badge.fontWeight,
66+
marginTop: -1,
67+
}
5268
};

styles/native/ts/types/widgets.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,9 @@ export interface TabContainerType {
411411
indicator?: ViewStyle,
412412
tab?: ViewStyle,
413413
label?: TextStyle,
414-
activeLabel?: TextStyle
414+
activeLabel?: TextStyle,
415+
badgeContainer?: ViewStyle,
416+
badgeCaption?: TextStyle
415417
}
416418

417419
// Text Box

styles/web/css/main.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

styles/web/css/main.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

styles/web/sass/core/widgets/_tabcontainer.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,14 @@
8484
}
8585
}
8686
}
87+
88+
.mx-tabcontainer-badge {
89+
margin-left: 8px;
90+
border-radius: $font-size-small;
91+
background-color: $label-primary-bg;
92+
color: $label-primary-color;
93+
font-size: $font-size-small;
94+
font-weight: $font-weight-bold;
95+
line-height: 1;
96+
padding: 3px 7px;
97+
}

0 commit comments

Comments
 (0)