2021-12-12 09:39:02 +00:00
|
|
|
// 主题颜色
|
|
|
|
// 浅色 --> 默认使用
|
|
|
|
@ligh-background: #FFF;
|
|
|
|
@ligh-color: #3a3a3a;
|
|
|
|
|
|
|
|
// 深色
|
|
|
|
@dark-background: #353535;
|
|
|
|
@dark-color: #FFF;
|
|
|
|
|
|
|
|
@border-clor: #cecece;
|
|
|
|
|
|
|
|
// 单一设置主题
|
2021-12-14 16:33:44 +00:00
|
|
|
.single-theme(@position, @contrary_position, @margin_postion, @color, @m-border-color) {
|
2021-12-12 09:39:02 +00:00
|
|
|
@attr : ~'[position=@{position}]';
|
2021-12-14 16:33:44 +00:00
|
|
|
&{
|
|
|
|
border: 1px solid @m-border-color;
|
|
|
|
&.layui-popper@{attr}{
|
2021-12-12 09:39:02 +00:00
|
|
|
margin-@{contrary_position}: 6px;
|
|
|
|
.layui-popper-arrow {
|
|
|
|
@{contrary_position}: -6px;
|
|
|
|
border-@{contrary_position}-width: 0;
|
2021-12-14 16:33:44 +00:00
|
|
|
border-@{position}-color: @m-border-color;
|
2021-12-12 09:39:02 +00:00
|
|
|
&::after{
|
|
|
|
@{contrary_position}: 1px;
|
|
|
|
border-@{contrary_position}-width: 0;
|
|
|
|
margin-@{margin_postion}: -6px;
|
|
|
|
border-@{position}-color: @color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-12-14 16:33:44 +00:00
|
|
|
}
|
2021-12-12 09:39:02 +00:00
|
|
|
}
|
|
|
|
// 统一设置四个方向的主题
|
2021-12-14 16:33:44 +00:00
|
|
|
.theme(@background-color, @color, @border-color) {
|
2021-12-12 09:39:02 +00:00
|
|
|
background-color: @background-color;
|
|
|
|
color: @color;
|
2021-12-14 16:33:44 +00:00
|
|
|
.single-theme(top, bottom, left, @background-color, @border-color);
|
|
|
|
.single-theme(bottom, top, left, @background-color, @border-color);
|
|
|
|
.single-theme(right, left, top, @background-color, @border-color);
|
|
|
|
.single-theme(left, right, top, @background-color, @border-color);
|
2021-12-12 09:39:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// 箭头默认居中
|
|
|
|
.arrow-default-center(@position, @prop) {
|
|
|
|
@attr : ~'[position=@{position}]';
|
|
|
|
&.layui-popper@{attr} {
|
|
|
|
.layui-popper-arrow{
|
|
|
|
@{prop}: -moz-calc(50% - 6px);
|
|
|
|
@{prop}: -webkit-calc(50% - 6px);
|
|
|
|
@{prop}: calc(50% - 6px);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.all-arrow-default-center() {
|
|
|
|
.arrow-default-center(top, left);
|
|
|
|
.arrow-default-center(bottom, left);
|
|
|
|
.arrow-default-center(left, top);
|
|
|
|
.arrow-default-center(right, top);
|
|
|
|
}
|
|
|
|
|
|
|
|
// 样式开始
|
|
|
|
.layui-popper {
|
|
|
|
position: fixed;
|
|
|
|
padding: 10px;
|
|
|
|
border-radius: 3px;
|
|
|
|
word-wrap: break-word;
|
|
|
|
min-width: 12px;
|
|
|
|
min-height: 12px;
|
|
|
|
font-size: 14px;
|
|
|
|
box-sizing: border-box;
|
|
|
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.15);
|
2021-12-14 16:33:44 +00:00
|
|
|
.theme(@ligh-background, @ligh-color, @border-clor);
|
2021-12-12 09:39:02 +00:00
|
|
|
max-width: 300px;
|
|
|
|
z-index: 9999;
|
|
|
|
|
|
|
|
// 箭头默认居中
|
|
|
|
.all-arrow-default-center();
|
|
|
|
|
|
|
|
.layui-popper-arrow {
|
|
|
|
&,&::after{
|
|
|
|
position: absolute;
|
|
|
|
display: block;
|
|
|
|
width: 0;
|
|
|
|
height: 0;
|
|
|
|
border-width: 6px;
|
|
|
|
border-style: solid;
|
|
|
|
border-color: transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
&::after{
|
|
|
|
content: ' ';
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 深色主题 */
|
|
|
|
&.layui-dark {
|
2021-12-14 16:33:44 +00:00
|
|
|
.theme(@dark-background, @dark-color, @dark-background);
|
2021-12-12 09:39:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|