Skip to content

Commit a175cfb

Browse files
authored
chore(compass-components): less document whitespace (#6439)
* Decreasing padding around icon in expand button * Decrease padding of actions group container * Remove 10px from left side of trash icon * Shave 4px off between + and ▶ * Update "show more" offset
1 parent d7d58d5 commit a175cfb

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

packages/compass-components/src/components/document-list/document-actions-group.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ const actionsGroupContainer = css({
99
position: 'absolute',
1010
display: 'flex',
1111
alignItems: 'center',
12-
gap: spacing[2],
12+
gap: spacing[200],
1313
width: '100%',
14-
top: spacing[2] + spacing[1],
15-
paddingLeft: spacing[3],
16-
paddingRight: spacing[3],
14+
top: spacing[300],
15+
paddingLeft: spacing[300],
16+
paddingRight: spacing[300],
1717
pointerEvents: 'none',
1818
});
1919

@@ -44,6 +44,13 @@ const actionsGroupSignalPopover = css({
4444
display: 'block !important',
4545
});
4646

47+
const expandButton = css({
48+
'& > div:has(svg)': {
49+
paddingLeft: 3,
50+
paddingRight: 3,
51+
},
52+
});
53+
4754
function useElementParentHoverState<T extends HTMLElement>(
4855
ref: React.RefObject<T>
4956
): boolean {
@@ -159,7 +166,7 @@ const DocumentActionsGroup: React.FunctionComponent<
159166
aria-pressed={expanded}
160167
data-testid="expand-document-button"
161168
onClick={onExpand}
162-
className={actionsGroupItem}
169+
className={cx(actionsGroupItem, expandButton)}
163170
tooltipText={expanded ? 'Collapse all' : 'Expand all'}
164171
/>
165172
)}

packages/compass-components/src/components/document-list/element.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ const expandButton = css({
192192

193193
const hadronElement = css({
194194
display: 'flex',
195-
paddingLeft: spacing[2],
196-
paddingRight: spacing[2],
195+
paddingLeft: spacing[50],
196+
paddingRight: spacing[50],
197197
marginTop: 1,
198198
});
199199

@@ -239,7 +239,7 @@ const elementRemovedDarkMode = css({
239239

240240
const elementActions = css({
241241
flex: 'none',
242-
width: spacing[3],
242+
width: spacing[300],
243243
position: 'relative',
244244
});
245245

@@ -364,7 +364,7 @@ const elementKeyDarkMode = css({
364364
});
365365

366366
const calculateElementSpacerWidth = (editable: boolean, level: number) => {
367-
return (editable ? spacing[200] : 0) + spacing[400] * level;
367+
return (editable ? spacing[100] : 0) + spacing[400] * level;
368368
};
369369

370370
export const calculateShowMoreToggleOffset = ({
@@ -377,10 +377,10 @@ export const calculateShowMoreToggleOffset = ({
377377
alignWithNestedExpandIcon: boolean;
378378
}) => {
379379
// the base padding that we have on all elements rendered in the document
380-
const BASE_PADDING_LEFT = spacing[200];
380+
const BASE_PADDING_LEFT = spacing[50];
381381
const OFFSET_WHEN_EDITABLE = editable
382382
? // space taken by element actions
383-
spacing[400] +
383+
spacing[300] +
384384
// space and margin taken by line number element
385385
spacing[400] +
386386
spacing[100] +

0 commit comments

Comments
 (0)