forked from codesandbox/codesandbox-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelements.ts
More file actions
87 lines (79 loc) · 1.79 KB
/
elements.ts
File metadata and controls
87 lines (79 loc) · 1.79 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
76
77
78
79
80
81
82
83
84
85
86
87
import styled, { css } from 'styled-components';
export const Container = styled.div`
display: flex;
background-color: ${props =>
props.theme['editor.background'] || props.theme.background()};
padding: 0.25rem;
align-items: center;
line-height: 1;
/* box-shadow: 0 1px 3px #ddd; */
height: 35px;
min-height: 35px;
box-sizing: border-box;
z-index: 2;
`;
export const Icons = styled.div`
display: flex;
`;
export const Icon = styled.button<{ moduleView?: boolean; disabled?: boolean }>`
display: inline-block;
border: none;
background-color: transparent;
font-size: 1.5rem;
line-height: 0.5;
margin: 0 0.25rem;
vertical-align: middle;
text-align: center;
padding: 0;
outline: none;
cursor: pointer;
svg path,
svg rect {
transition: 0.2s ease fill;
}
${({ moduleView, disabled, theme }) =>
!moduleView &&
(disabled
? css`
cursor: default;
opacity: 0.6;
`
: css`
&:hover svg path,
&:hover svg rect {
fill: ${theme.light ? 'black' : 'white'};
}
`)}
/* // TODO: Replace with new theme */
${({ moduleView, theme }) =>
moduleView &&
css`
${theme.light
? css`
svg rect[fill='#E6E6E6'] {
fill: #343434;
}
svg rect[fill='#343434'] {
fill: #e6e6e6;
}
&:hover svg rect {
fill: black;
}
`
: css`
&:hover svg rect:not([fill='#E6E6E6']) {
fill: #757575;
}
`}
`}
`;
export const IconWithBackground = styled(Icon)`
border-radius: 2px;
background-color: ${({ theme }) =>
theme['input.background'] || theme.background()};
`;
export const AddressBarContainer = styled.div`
width: 100%;
box-sizing: border-box;
margin: 0 0.25rem;
`;