From fc156cfca8a1f3f1bacab9b04246e4b9bb658381 Mon Sep 17 00:00:00 2001 From: Ahmet Tanakol Date: Thu, 30 Aug 2018 12:08:08 +0200 Subject: [PATCH] improve styling of material-tree-renderer --- .../src/tree/ObjectListItem.tsx | 18 ++++++++---------- .../src/tree/TreeWithDetailRenderer.tsx | 17 ++++++++--------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/packages/material-tree-renderer/src/tree/ObjectListItem.tsx b/packages/material-tree-renderer/src/tree/ObjectListItem.tsx index 002830015..befa73cd1 100644 --- a/packages/material-tree-renderer/src/tree/ObjectListItem.tsx +++ b/packages/material-tree-renderer/src/tree/ObjectListItem.tsx @@ -61,7 +61,6 @@ const styles: content: '""', position: 'absolute', left: '0.2em', - borderTop: '1px solid lightgrey', top: '0.5em', width: '1em' }, // tslint:disable-next-line:object-literal-key-quotes @@ -69,7 +68,6 @@ const styles: content: '""', position: 'absolute', left: '0.2em', - borderLeft: '1px solid lightgrey', top: '-0.5em', height: '100%' } @@ -94,7 +92,14 @@ const styles: marginRight: '0.25em', backgroundRepeat: 'no-repeat', backgroundPosition: 'center' - } + }, // tslint:disable-next-line:object-literal-key-quotes + '&:hover': { + fontWeight: 'bold', + cursor: 'pointer', + opacity: 0.9, + backgroundColor: theme.palette.secondary.main, + }, + alignItems: 'center' }, label: { display: 'flex', @@ -106,13 +111,6 @@ const styles: background: '#ffff00', maxHeight: '1.5em' }, // tslint:disable-next-line:object-literal-key-quotes - '&:hover': { - fontWeight: 'bold', - cursor: 'pointer', - color: 'white', - opacity: 0.9, - backgroundColor: theme.palette.secondary.main, - }, // tslint:disable-next-line:object-literal-key-quotes '&:hover $actionButton': { display: 'flex', justifyContent: 'center', // tslint:disable-next-line:object-literal-key-quotes diff --git a/packages/material-tree-renderer/src/tree/TreeWithDetailRenderer.tsx b/packages/material-tree-renderer/src/tree/TreeWithDetailRenderer.tsx index 944b802b1..5c0afe677 100644 --- a/packages/material-tree-renderer/src/tree/TreeWithDetailRenderer.tsx +++ b/packages/material-tree-renderer/src/tree/TreeWithDetailRenderer.tsx @@ -104,7 +104,10 @@ const styles: StyleRulesCallback<'treeMasterDetailContent' | 'treeMasterDetail' | 'treeMasterDetailMaster' | 'treeMasterDetailDetail'> = () => ({ - treeMasterDetailContent: {}, + treeMasterDetailContent: { + paddingTop: '1em', + paddingBottom: '1em' + }, // tslint:disable-next-line: object-literal-key-quotes treeMasterDetail: { display: 'flex', @@ -119,10 +122,9 @@ const styles: StyleRulesCallback<'treeMasterDetailContent' | treeMasterDetailMaster: { flex: 1, padding: '0.5em', - borderStyle: 'solid', + height: 'auto', + borderRight: '0.2em solid lightgrey', borderWidth: 'thin', - borderColor: 'lightgrey', - borderRadius: '0.2em', // tslint:disable-next-line:object-literal-key-quotes '& ul': { listStyleType: 'none', @@ -135,7 +137,6 @@ const styles: StyleRulesCallback<'treeMasterDetailContent' | content: '""', position: 'absolute', left: '0.2em', - borderLeft: '1px solid lightgrey', height: '0.6em', bottom: '0' }, // tslint:disable-next-line:object-literal-key-quotes @@ -148,10 +149,8 @@ const styles: StyleRulesCallback<'treeMasterDetailContent' | treeMasterDetailDetail: { flex: 3, padding: '0.5em', - borderStyle: 'solid', - borderWidth: 'thin', - borderColor: 'lightgrey', - borderRadius: '0.2em', // tslint:disable-next-line:object-literal-key-quotes + paddingLeft: '1em', + // tslint:disable-next-line:object-literal-key-quotes '&:first-child': { marginRight: '0.25em' }