-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathstyled.js
More file actions
75 lines (65 loc) · 1.9 KB
/
styled.js
File metadata and controls
75 lines (65 loc) · 1.9 KB
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
import styled from "styled-components"
import { getColor, getSizeBy } from "@/theme/utils"
import Flex from "@/components/templates/flex"
export const StyledTabsWrapper = styled(Flex).attrs(props => ({
column: true,
flexWrap: false,
...props,
}))``
export const StyledTabs = styled(Flex).attrs(props => ({
as: "nav",
row: true,
flexWrap: false,
justifyContent: "start",
alignItems: "center",
padding: [0, 0.5],
flex: false,
border: !props.noDefaultBorder && {
side: "bottom",
size: "1px",
type: "solid",
color: "border",
},
...props,
}))``
export const StyledTab = styled(Flex).attrs(props => ({
small: true,
padding: [0, 6],
...props,
}))`
white-space: nowrap;
border-bottom: 1px solid
${({ active, green }) =>
active ? getColor("accent") : green ? getColor(["transparent", "full"]) : getColor("border")};
box-sizing: border-box;
border-radius: 2px 2px 0 0;
max-width: ${({ maxWidth }) => maxWidth ?? getSizeBy(26)};
height: ${({ small, green }) =>
green ? (small ? getSizeBy(3) : getSizeBy(4)) : small ? getSizeBy(4) : getSizeBy(5)};
cursor: pointer;
opacity: ${({ disabled }) => (disabled ? 0.4 : 1)};
background: ${({ active }) =>
active ? getColor("menuItemSelected") : getColor("modalBackground")};
pointer-events: ${({ disabled }) => (disabled ? "none" : "auto")};
margin-bottom: -1px;
&:hover {
border-bottom: 1px solid ${getColor("primary")};
}
& > span {
color: ${({ active }) => (active ? getColor("primary") : getColor("menuItem"))};
}
`
export const StyledTabMenu = styled(Flex)`
white-space: nowrap;
color: ${getColor("text")};
padding: 4px 8px;
background: ${({ active }) =>
active ? getColor("menuItemSelected") : getColor(["transparent", "full"])};
width: 100%;
border-radius: 4px;
cursor: pointer;
justify-content: flex-start;
&:hover {
background: ${getColor("menuItemHover")};
}
`