forked from codesandbox/codesandbox-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelements.js
More file actions
61 lines (53 loc) · 1.39 KB
/
elements.js
File metadata and controls
61 lines (53 loc) · 1.39 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
import styled from 'styled-components';
import css from '@styled-system/css';
import { HeartIconSVG, ReloadIconSVG, NewWindowIconSVG } from './icons';
export const Container = styled.div(props =>
css({
position: 'absolute',
[props.align]: 16,
zIndex: 99,
display: 'flex',
// margin between consecutive elements
'* + *': {
marginLeft: 1,
},
// 28 is the height of console
bottom: props.isDragging ? -32 : props.offsetBottom ? 28 + 16 : 16,
opacity: props.isDragging ? 0 : 1,
transitionProperty: 'opacity, bottom',
transitionDuration: theme =>
// go out fast, come back slow
props.isDragging ? theme.speed[3] : theme.speed[5],
})
);
export const Button = styled.button(
css({
display: 'inline-flex',
alignItems: 'center',
height: 32,
paddingX: 3,
paddingY: 0,
fontSize: 3,
fontWeight: 'medium',
border: '1px solid',
borderColor: 'grays.500',
color: 'white',
backgroundColor: 'grays.700',
borderRadius: 4,
textDecoration: 'none',
cursor: 'pointer',
':hover': {
backgroundColor: 'grays.500',
},
})
);
export const HeartIcon = styled(HeartIconSVG)(props =>
css({
path: {
stroke: props.liked ? 'reds.300' : 'white',
fill: props.liked ? 'reds.300' : 'none',
},
})
);
export const ReloadIcon = ReloadIconSVG;
export const NewWindowIcon = NewWindowIconSVG;