Skip to content

Commit fc156cf

Browse files
Ahmetanakoledgarmueller
authored andcommitted
improve styling of material-tree-renderer
1 parent 93439dc commit fc156cf

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

packages/material-tree-renderer/src/tree/ObjectListItem.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,13 @@ const styles:
6161
content: '""',
6262
position: 'absolute',
6363
left: '0.2em',
64-
borderTop: '1px solid lightgrey',
6564
top: '0.5em',
6665
width: '1em'
6766
}, // tslint:disable-next-line:object-literal-key-quotes
6867
'&:after': {
6968
content: '""',
7069
position: 'absolute',
7170
left: '0.2em',
72-
borderLeft: '1px solid lightgrey',
7371
top: '-0.5em',
7472
height: '100%'
7573
}
@@ -94,7 +92,14 @@ const styles:
9492
marginRight: '0.25em',
9593
backgroundRepeat: 'no-repeat',
9694
backgroundPosition: 'center'
97-
}
95+
}, // tslint:disable-next-line:object-literal-key-quotes
96+
'&:hover': {
97+
fontWeight: 'bold',
98+
cursor: 'pointer',
99+
opacity: 0.9,
100+
backgroundColor: theme.palette.secondary.main,
101+
},
102+
alignItems: 'center'
98103
},
99104
label: {
100105
display: 'flex',
@@ -106,13 +111,6 @@ const styles:
106111
background: '#ffff00',
107112
maxHeight: '1.5em'
108113
}, // tslint:disable-next-line:object-literal-key-quotes
109-
'&:hover': {
110-
fontWeight: 'bold',
111-
cursor: 'pointer',
112-
color: 'white',
113-
opacity: 0.9,
114-
backgroundColor: theme.palette.secondary.main,
115-
}, // tslint:disable-next-line:object-literal-key-quotes
116114
'&:hover $actionButton': {
117115
display: 'flex',
118116
justifyContent: 'center', // tslint:disable-next-line:object-literal-key-quotes

packages/material-tree-renderer/src/tree/TreeWithDetailRenderer.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ const styles: StyleRulesCallback<'treeMasterDetailContent' |
104104
'treeMasterDetail' |
105105
'treeMasterDetailMaster' |
106106
'treeMasterDetailDetail'> = () => ({
107-
treeMasterDetailContent: {},
107+
treeMasterDetailContent: {
108+
paddingTop: '1em',
109+
paddingBottom: '1em'
110+
},
108111
// tslint:disable-next-line: object-literal-key-quotes
109112
treeMasterDetail: {
110113
display: 'flex',
@@ -119,10 +122,9 @@ const styles: StyleRulesCallback<'treeMasterDetailContent' |
119122
treeMasterDetailMaster: {
120123
flex: 1,
121124
padding: '0.5em',
122-
borderStyle: 'solid',
125+
height: 'auto',
126+
borderRight: '0.2em solid lightgrey',
123127
borderWidth: 'thin',
124-
borderColor: 'lightgrey',
125-
borderRadius: '0.2em',
126128
// tslint:disable-next-line:object-literal-key-quotes
127129
'& ul': {
128130
listStyleType: 'none',
@@ -135,7 +137,6 @@ const styles: StyleRulesCallback<'treeMasterDetailContent' |
135137
content: '""',
136138
position: 'absolute',
137139
left: '0.2em',
138-
borderLeft: '1px solid lightgrey',
139140
height: '0.6em',
140141
bottom: '0'
141142
}, // tslint:disable-next-line:object-literal-key-quotes
@@ -148,10 +149,8 @@ const styles: StyleRulesCallback<'treeMasterDetailContent' |
148149
treeMasterDetailDetail: {
149150
flex: 3,
150151
padding: '0.5em',
151-
borderStyle: 'solid',
152-
borderWidth: 'thin',
153-
borderColor: 'lightgrey',
154-
borderRadius: '0.2em', // tslint:disable-next-line:object-literal-key-quotes
152+
paddingLeft: '1em',
153+
// tslint:disable-next-line:object-literal-key-quotes
155154
'&:first-child': {
156155
marginRight: '0.25em'
157156
}

0 commit comments

Comments
 (0)