Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 3ca957b

Browse files
authored
Update _ResizeHandle.pcss (#10772)
* Nesting: `mx_ResizeHandle` * Nesting: `> div` * Run prettier * Use a custom property * Remove a redundant declaration: `cursor: row-resize` The resizer is either vertical or horizontal, and since `cursor: row-resize` is applied by default, it does not need to be repeated here. * Conform the class names to the naming policy * Revert "Use a custom property" This reverts commit 6116939.
1 parent 0d2af83 commit 3ca957b

File tree

8 files changed

+29
-30
lines changed

8 files changed

+29
-30
lines changed

Diff for: res/css/structures/_MainSplit.pcss

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ limitations under the License.
2929
padding-left: calc(var(--container-gap-width) / 2);
3030
height: calc(100vh - 51px); /* height of .mx_RoomHeader.light-panel */
3131

32-
&:hover .mx_ResizeHandle_horizontal::before {
32+
&:hover .mx_ResizeHandle--horizontal::before {
3333
position: absolute;
3434
top: 50%;
3535
left: 50%;

Diff for: res/css/structures/_MatrixChat.pcss

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ limitations under the License.
8080
/* negative margin greater than its positive padding. If it's the same */
8181
/* or less, Safari and other WebKit based browsers get confused about overflows somehow and */
8282
/* https://github.com/vector-im/element-web/issues/19863 happens. */
83-
.mx_MatrixChat > .mx_ResizeHandle.mx_ResizeHandle_horizontal {
83+
.mx_MatrixChat > .mx_ResizeHandle.mx_ResizeHandle--horizontal {
8484
margin: 0 calc(-5.5px - var(--container-gap-width) / 2) 0 calc(-6.5px + var(--container-gap-width) / 2);
8585
/* The condition to prevent bleeding is: (margin-left + margin-right < -11px) */
8686
/* (IF there is NO margin on the leftPanel_wrapper) */
@@ -94,7 +94,7 @@ limitations under the License.
9494
/* We want the handle to be in the middle of the gap so it is shifted by (var(--container-gap-width) / 2) */
9595
}
9696

97-
.mx_MatrixChat > .mx_ResizeHandle_horizontal:hover {
97+
.mx_MatrixChat > .mx_ResizeHandle--horizontal:hover {
9898
position: relative;
9999

100100
&::before {

Diff for: res/css/views/elements/_ResizeHandle.pcss

+19-20
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,24 @@ limitations under the License.
1818
cursor: row-resize;
1919
flex: 0 0 auto;
2020
z-index: 100;
21-
}
22-
23-
.mx_ResizeHandle.mx_ResizeHandle_horizontal {
24-
margin: 0 -5px;
25-
padding: 0 5px;
26-
cursor: col-resize;
27-
}
28-
29-
.mx_ResizeHandle.mx_ResizeHandle_vertical {
30-
margin: -5px 0;
31-
padding: 5px 0;
32-
cursor: row-resize;
33-
}
34-
35-
.mx_ResizeHandle.mx_ResizeHandle_horizontal > div {
36-
width: 1px;
37-
height: 100%;
38-
}
3921

40-
.mx_ResizeHandle.mx_ResizeHandle_vertical > div {
41-
height: 1px;
22+
&.mx_ResizeHandle--horizontal {
23+
margin: 0 -5px;
24+
padding: 0 5px;
25+
cursor: col-resize;
26+
27+
> div {
28+
width: 1px;
29+
height: 100%;
30+
}
31+
}
32+
33+
&.mx_ResizeHandle--vertical {
34+
margin: -5px 0;
35+
padding: 5px 0;
36+
37+
> div {
38+
height: 1px;
39+
}
40+
}
4241
}

Diff for: res/css/views/rooms/_AppsDrawer.pcss

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ $MinWidth: 240px;
7575
background: $primary-content;
7676
}
7777

78-
.mx_ResizeHandle_horizontal::before {
78+
.mx_ResizeHandle--horizontal::before {
7979
position: absolute;
8080
left: 3px;
8181
top: 50%;
@@ -140,7 +140,7 @@ $MinWidth: 240px;
140140
border-radius: 0 10px 10px 0;
141141
}
142142

143-
.mx_ResizeHandle_horizontal {
143+
.mx_ResizeHandle--horizontal {
144144
position: relative;
145145

146146
> div {

Diff for: src/components/structures/LoggedInView.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ class LoggedInView extends React.Component<IProps, IState> {
264264
const resizer = new Resizer(this._resizeContainer.current, CollapseDistributor, collapseConfig);
265265
resizer.setClassNames({
266266
handle: "mx_ResizeHandle",
267-
vertical: "mx_ResizeHandle_vertical",
267+
vertical: "mx_ResizeHandle--vertical",
268268
});
269269
return resizer;
270270
}

Diff for: src/components/structures/MainSplit.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export default class MainSplit extends React.Component<IProps> {
8787
onResize={this.onResize}
8888
onResizeStop={this.onResizeStop}
8989
className="mx_RightPanel_ResizeWrapper"
90-
handleClasses={{ left: "mx_ResizeHandle_horizontal" }}
90+
handleClasses={{ left: "mx_ResizeHandle--horizontal" }}
9191
>
9292
{panelView}
9393
</Resizable>

Diff for: src/components/views/elements/ResizeHandle.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ interface IResizeHandleProps {
2626
const ResizeHandle: React.FC<IResizeHandleProps> = ({ vertical, id, passRef }) => {
2727
const classNames = ["mx_ResizeHandle"];
2828
if (vertical) {
29-
classNames.push("mx_ResizeHandle_vertical");
29+
classNames.push("mx_ResizeHandle--vertical");
3030
} else {
31-
classNames.push("mx_ResizeHandle_horizontal");
31+
classNames.push("mx_ResizeHandle--horizontal");
3232
}
3333
return (
3434
<div ref={passRef} className={classNames.join(" ")} data-id={id}>

Diff for: src/components/views/rooms/AppsDrawer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export default class AppsDrawer extends React.Component<IProps, IState> {
109109
// (ie. a vertical resize handle because, the handle itself is vertical...)
110110
const classNames = {
111111
handle: "mx_ResizeHandle",
112-
vertical: "mx_ResizeHandle_vertical",
112+
vertical: "mx_ResizeHandle--vertical",
113113
};
114114
const collapseConfig = {
115115
onResizeStart: () => {

0 commit comments

Comments
 (0)