|
@@ -126,93 +126,106 @@ $active-border-width: 2px;
|
|
$hover-border-width: 1px;
|
|
$hover-border-width: 1px;
|
|
$name-position: -85px;
|
|
$name-position: -85px;
|
|
$toolbar-position: -55px;
|
|
$toolbar-position: -55px;
|
|
|
|
+
|
|
/* 组件 */
|
|
/* 组件 */
|
|
.component {
|
|
.component {
|
|
position: relative;
|
|
position: relative;
|
|
cursor: move;
|
|
cursor: move;
|
|
|
|
+
|
|
.component-wrap {
|
|
.component-wrap {
|
|
- display: block;
|
|
|
|
position: absolute;
|
|
position: absolute;
|
|
- left: -$active-border-width;
|
|
|
|
top: 0;
|
|
top: 0;
|
|
|
|
+ left: -$active-border-width;
|
|
|
|
+ display: block;
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 100%;
|
|
height: 100%;
|
|
|
|
+
|
|
/* 鼠标放到组件上时 */
|
|
/* 鼠标放到组件上时 */
|
|
&:hover {
|
|
&:hover {
|
|
border: $hover-border-width dashed var(--el-color-primary);
|
|
border: $hover-border-width dashed var(--el-color-primary);
|
|
- box-shadow: 0 0 5px 0 rgba(24, 144, 255, 0.3);
|
|
|
|
|
|
+ box-shadow: 0 0 5px 0 rgb(24 144 255 / 30%);
|
|
|
|
+
|
|
.component-name {
|
|
.component-name {
|
|
|
|
+ top: $hover-border-width;
|
|
|
|
+
|
|
/* 防止加了边框之后,位置移动 */
|
|
/* 防止加了边框之后,位置移动 */
|
|
left: $name-position - $hover-border-width;
|
|
left: $name-position - $hover-border-width;
|
|
- top: $hover-border-width;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
/* 左侧:组件名称 */
|
|
/* 左侧:组件名称 */
|
|
.component-name {
|
|
.component-name {
|
|
- display: block;
|
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
|
+ top: $active-border-width;
|
|
|
|
+ left: $name-position;
|
|
|
|
+ display: block;
|
|
width: 80px;
|
|
width: 80px;
|
|
- text-align: center;
|
|
|
|
- line-height: 25px;
|
|
|
|
height: 25px;
|
|
height: 25px;
|
|
- background: #fff;
|
|
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
- left: $name-position;
|
|
|
|
- top: $active-border-width;
|
|
|
|
|
|
+ line-height: 25px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ background: #fff;
|
|
box-shadow:
|
|
box-shadow:
|
|
0 0 4px #00000014,
|
|
0 0 4px #00000014,
|
|
0 2px 6px #0000000f,
|
|
0 2px 6px #0000000f,
|
|
0 4px 8px 2px #0000000a;
|
|
0 4px 8px 2px #0000000a;
|
|
|
|
+
|
|
/* 右侧小三角 */
|
|
/* 右侧小三角 */
|
|
- &:after {
|
|
|
|
|
|
+ &::after {
|
|
position: absolute;
|
|
position: absolute;
|
|
top: 7.5px;
|
|
top: 7.5px;
|
|
right: -10px;
|
|
right: -10px;
|
|
- content: ' ';
|
|
|
|
- height: 0;
|
|
|
|
width: 0;
|
|
width: 0;
|
|
|
|
+ height: 0;
|
|
border: 5px solid transparent;
|
|
border: 5px solid transparent;
|
|
border-left-color: #fff;
|
|
border-left-color: #fff;
|
|
|
|
+ content: ' ';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
/* 右侧:组件操作工具栏 */
|
|
/* 右侧:组件操作工具栏 */
|
|
.component-toolbar {
|
|
.component-toolbar {
|
|
- display: none;
|
|
|
|
position: absolute;
|
|
position: absolute;
|
|
top: 0;
|
|
top: 0;
|
|
right: $toolbar-position;
|
|
right: $toolbar-position;
|
|
|
|
+ display: none;
|
|
|
|
+
|
|
/* 左侧小三角 */
|
|
/* 左侧小三角 */
|
|
- &:before {
|
|
|
|
|
|
+ &::before {
|
|
position: absolute;
|
|
position: absolute;
|
|
top: 10px;
|
|
top: 10px;
|
|
left: -10px;
|
|
left: -10px;
|
|
- content: ' ';
|
|
|
|
- height: 0;
|
|
|
|
width: 0;
|
|
width: 0;
|
|
|
|
+ height: 0;
|
|
border: 5px solid transparent;
|
|
border: 5px solid transparent;
|
|
border-right-color: #2d8cf0;
|
|
border-right-color: #2d8cf0;
|
|
|
|
+ content: ' ';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
/* 组件选中时 */
|
|
/* 组件选中时 */
|
|
&.active {
|
|
&.active {
|
|
margin-bottom: 4px;
|
|
margin-bottom: 4px;
|
|
|
|
|
|
.component-wrap {
|
|
.component-wrap {
|
|
- border: $active-border-width solid var(--el-color-primary) !important;
|
|
|
|
- box-shadow: 0 0 10px 0 rgba(24, 144, 255, 0.3);
|
|
|
|
margin-bottom: $active-border-width + $active-border-width;
|
|
margin-bottom: $active-border-width + $active-border-width;
|
|
|
|
+ border: $active-border-width solid var(--el-color-primary) !important;
|
|
|
|
+ box-shadow: 0 0 10px 0 rgb(24 144 255 / 30%);
|
|
|
|
|
|
.component-name {
|
|
.component-name {
|
|
- background: var(--el-color-primary);
|
|
|
|
- color: #fff;
|
|
|
|
|
|
+ top: 0 !important;
|
|
|
|
+
|
|
/* 防止加了边框之后,位置移动 */
|
|
/* 防止加了边框之后,位置移动 */
|
|
left: $name-position - $active-border-width !important;
|
|
left: $name-position - $active-border-width !important;
|
|
- top: 0 !important;
|
|
|
|
- &:after {
|
|
|
|
|
|
+ color: #fff;
|
|
|
|
+ background: var(--el-color-primary);
|
|
|
|
+
|
|
|
|
+ &::after {
|
|
border-left-color: var(--el-color-primary);
|
|
border-left-color: var(--el-color-primary);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
.component-toolbar {
|
|
.component-toolbar {
|
|
display: block;
|
|
display: block;
|
|
}
|
|
}
|