Skip to content

Commit a388eb5

Browse files
authored
Tabs - New style (#574)
* Change tabs styles to align with the new design * Simplify border width * Decrease large tab height * v5.0.57
1 parent f2551da commit a388eb5

2 files changed

Lines changed: 20 additions & 23 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@netdata/netdata-ui",
3-
"version": "5.0.56",
3+
"version": "5.0.57",
44
"description": "netdata UI kit",
55
"main": "dist/index.js",
66
"module": "dist/es6/index.js",

src/components/tabs/styled.js

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,48 +20,45 @@ export const StyledTabs = styled(Flex).attrs(props => ({
2020
side: "bottom",
2121
size: "1px",
2222
type: "solid",
23-
color: "borderSecondary",
23+
color: "border",
2424
},
2525
...props,
2626
}))``
2727

28-
export const StyledTab = styled(Flex).attrs(props => ({ flex: "grow", ...props }))`
28+
export const StyledTab = styled(Flex).attrs(props => ({
29+
small: true,
30+
padding: [0, 6],
31+
...props,
32+
}))`
2933
white-space: nowrap;
30-
border-bottom: ${({ small, green }) => (green ? "1px" : small ? "2px" : "4px")} solid
31-
${({ active }) => (active ? getColor("accent") : getColor(["transparent", "full"]))};
34+
border-bottom: 1px solid
35+
${({ active, green }) =>
36+
active ? getColor("accent") : green ? getColor(["transparent", "full"]) : getColor("border")};
3237
box-sizing: border-box;
3338
34-
min-width: ${({ minWidth }) => minWidth ?? getSizeBy(10)};
39+
border-radius: 4px 4px 0 0;
40+
3541
max-width: ${({ maxWidth }) => maxWidth ?? getSizeBy(26)};
3642
height: ${({ small, green }) =>
37-
green ? (small ? getSizeBy(3) : getSizeBy(4)) : small ? getSizeBy(4) : getSizeBy(6)};
38-
color: ${props =>
39-
props.green
40-
? props.active
41-
? getColor("primary")(props)
42-
: getColor("menuItem")(props)
43-
: getColor("text")(props)};
44-
font-weight: ${({ active }) => (active ? "bold" : "normal")};
43+
green ? (small ? getSizeBy(3) : getSizeBy(4)) : small ? getSizeBy(4) : getSizeBy(5)};
4544
4645
cursor: pointer;
4746
opacity: ${({ disabled }) => (disabled ? 0.4 : 1)};
48-
background: ${props =>
49-
props.green
50-
? props.active
51-
? getColor("menuItemSelected")(props)
52-
: getColor("modalBackground")(props)
53-
: "transparent"};
47+
background: ${({ active }) =>
48+
active ? getColor("menuItemSelected") : getColor("modalBackground")};
5449
pointer-events: ${({ disabled }) => (disabled ? "none" : "auto")};
5550
51+
margin-bottom: -1px;
52+
5653
&:hover {
57-
border-bottom: ${({ small, green }) => (green ? "1px" : small ? "2px" : "4px")} solid
58-
${getColor("primary")};
54+
border-bottom: 1px solid ${getColor("primary")};
5955
}
6056
6157
& > span {
62-
font-weight: ${({ active }) => (active ? "bold" : "normal")};
58+
color: ${({ active }) => (active ? getColor("primary") : getColor("menuItem"))};
6359
}
6460
`
61+
6562
export const StyledTabMenu = styled(Flex)`
6663
white-space: nowrap;
6764
color: ${getColor("text")};

0 commit comments

Comments
 (0)