Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Commit 8b8a19c

Browse files
markusoelhafentilmx
authored andcommitted
feat: update styling of preview resize handles (#410)
* fix(component): update resize pattern ux * fix(app): remove unneeded comma * fix(component): adjust resize hover styling * fix(component): add transition on hover
1 parent e7e8534 commit 8b8a19c

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

src/component/container/app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export class App extends React.Component {
163163
key="center"
164164
id="preview"
165165
previewFrame={`http://localhost:${store.getServerPort()}/preview.html`}
166-
/>,
166+
/>
167167
<SideBar side="right" directionVertical hasBorder>
168168
{store.getRightPane() === RightPane.Properties && (
169169
<PropertyPane>

src/lsg/patterns/panes/preview-pane/index.tsx

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,48 @@ const StyledPreviewWrapper = styled.div`
2222
`;
2323

2424
const StyledPreviewResizer = styled.div`
25-
width: 9px;
25+
position: absolute;
26+
top: 0;
27+
left: 0;
28+
width: 11px;
2629
height: 100%;
2730
cursor: ew-resize;
31+
background-color: ${colors.blackAlpha13.toString()};
32+
opacity: 0;
33+
transition: opacity 0.15s ease-in-out;
34+
2835
&::after {
2936
content: '';
3037
position: absolute;
3138
top: 50%;
3239
transform: translateY(-50%);
3340
height: 36px;
3441
width: 3px;
35-
margin: 3px;
42+
margin: 4px;
3643
border-radius: 2px;
3744
background: ${colors.grey80.toString()};
3845
}
3946
4047
&:hover {
48+
opacity: 1;
4149
&::after {
4250
background: ${colors.grey60.toString()};
4351
}
4452
}
4553
&:active {
54+
opacity: 1;
4655
&::after {
47-
background: ${colors.blue40.toString()};
56+
background: ${colors.white.toString()};
4857
}
4958
}
59+
&:last-of-type {
60+
right: 0;
61+
left: auto;
62+
}
5063
`;
5164

5265
const BaseStyledPreviewPane = styled.div`
66+
position: relative;
5367
flex-grow: 1;
5468
overflow: hidden;
5569
background: ${colors.white.toString()};
@@ -83,11 +97,11 @@ export default class PreviewPane extends React.Component<PreviewPaneProps> {
8397
onMouseMove={props.onMouseMove}
8498
onMouseUp={props.onMouseUp}
8599
>
86-
<StyledPreviewResizer onMouseDown={props.onMouseDownLeft} />
87100
<StyledPreviewPane width={props.width}>
101+
<StyledPreviewResizer onMouseDown={props.onMouseDownLeft} />
88102
<StyledPreviewFrame src={props.previewFrame} />
103+
<StyledPreviewResizer onMouseDown={props.onMouseDownRight} />
89104
</StyledPreviewPane>
90-
<StyledPreviewResizer onMouseDown={props.onMouseDownRight} />
91105
</StyledPreviewWrapper>
92106
);
93107
}

0 commit comments

Comments
 (0)