forked from coobbi/JavaStudy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathToolbar.ts
More file actions
67 lines (58 loc) · 1.6 KB
/
Toolbar.ts
File metadata and controls
67 lines (58 loc) · 1.6 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
import styled, { ThemedStyledInterface } from 'styled-components';
import { Base16Theme } from 'base16';
import * as CSS from 'csstype';
export type BorderPosition = 'top' | 'bottom';
export interface Props {
fullHeight?: boolean;
compact?: boolean;
borderPosition?: BorderPosition;
noBorder?: boolean;
}
const Toolbar = (
styled as ThemedStyledInterface<
Base16Theme & { fontFamily?: CSS.Property.FontFamily }
>
).div<Props>`
display: flex;
flex-shrink: 0;
box-sizing: border-box;
width: 100%;
font-family: ${(props) => props.theme.fontFamily || 'monospace'};
font-size: 12px;
line-height: 16px;
${(props) => props.fullHeight && 'height: 100%;'}
padding: ${(props) => (props.compact ? '0' : '5px')} 5px;
background-color: ${(props) => props.theme.base01};
text-align: center;
position: relative;
${({ borderPosition, theme }) =>
borderPosition && `border-${borderPosition}: 1px solid ${theme.base02};`}
& > div {
margin: auto ${(props) => (props.noBorder ? '0' : '1px;')};
}
& button {
border-radius: 0;
${(props) => props.noBorder && 'border-color: transparent;'}
white-space: nowrap;
box-shadow: none !important;
}
& > .Select {
position: static;
text-align: left;
margin: auto 1px;
flex-grow: 1;
.Select-control {
cursor: pointer;
border-radius: 0 !important;
text-align: center;
background-color: ${(props) => props.theme.base01};
}
.Select-menu-outer {
margin-top: 5px;
}
}
& > .Select.is-focused > .Select-control {
text-align: left;
}
`;
export default Toolbar;