mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 20:09:08 +08:00
33686a375e
* 使用自定义 css 属性初步,支持大部分组件的展现 * button 大部分可以看了 * cxd 和 dark 大部分正常 * 修复一些细节样式错误;补充 css 变量的文档 * 修复几个脚本发现的错误 * 完善一下注释 * 修复一些样式不一致问题 * 修复可能存在的 css xss * 恢复 font-variant 功能 * 修复绝大部分 @if 相关的问题 * 恢复之前的注释 * 修复小错误,并将所有 background-color 改成 background,这样就能设置渐变色 * 修复 button group 在 cxd 下不一致问题 * 缩小查看配置和复制配置的宽度,留出更多空间 * 修复一些潜在的错误 * 恢复 utilities 中 label 背景色的设置 * 修复错误的 css 变量 * 补充 IE11 Variables Polyfill
296 lines
5.0 KiB
SCSS
296 lines
5.0 KiB
SCSS
.#{$ns}CBGroup {
|
|
font-size: var(--fontSizeSm);
|
|
|
|
&-toolbar {
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
padding-bottom: 10px;
|
|
|
|
.#{$ns}Button {
|
|
transition: padding 0.2s;
|
|
min-width: unset;
|
|
|
|
svg {
|
|
width: 10px;
|
|
height: 10px;
|
|
top: 0;
|
|
margin-right: 5px;
|
|
}
|
|
}
|
|
|
|
&:not(:hover) .#{$ns}CBGroup-toolbarLeft .#{$ns}Button:not(.is-active) {
|
|
width: 0;
|
|
padding: 0;
|
|
overflow: hidden;
|
|
opacity: 0;
|
|
margin: 0;
|
|
border: 0;
|
|
}
|
|
|
|
.#{$ns}CBGroup-toolbarRight {
|
|
transition: opacity 0.2s;
|
|
display: flex;
|
|
align-items: center;
|
|
|
|
.#{$ns}CBDelete {
|
|
margin-left: var(--gap-xs);
|
|
}
|
|
}
|
|
&:not(:hover) .#{$ns}CBGroup-toolbarRight {
|
|
opacity: 0;
|
|
}
|
|
}
|
|
|
|
&-field,
|
|
&-operator {
|
|
position: relative;
|
|
display: inline-block;
|
|
margin: px2rem(3px);
|
|
vertical-align: middle;
|
|
}
|
|
|
|
&-fieldCaret,
|
|
&-operatorCaret {
|
|
transition: transform 0.3s ease-out;
|
|
margin: 5px;
|
|
display: flex;
|
|
color: var(--Form-select-caret-iconColor);
|
|
&:hover {
|
|
color: var(--Form-select-caret-onHover-iconColor);
|
|
}
|
|
|
|
> svg {
|
|
width: px2rem(10px);
|
|
height: px2rem(10px);
|
|
top: 0;
|
|
}
|
|
}
|
|
|
|
&-fieldInput.is-active &-fieldCaret,
|
|
&-operatorInput.is-active &-operatorCaret {
|
|
transform: rotate(180deg);
|
|
}
|
|
|
|
&-placeholder {
|
|
color: var(--text--muted-color);
|
|
position: relative;
|
|
margin-left: 30px;
|
|
padding: 10px;
|
|
background: rgba(0, 0, 0, 0.03);
|
|
border-radius: 5px;
|
|
|
|
&:before {
|
|
position: absolute;
|
|
content: '';
|
|
top: -10px;
|
|
left: -30px;
|
|
width: 20px;
|
|
border-left: solid 1px var(--borderColor);
|
|
bottom: 0;
|
|
}
|
|
|
|
&:after {
|
|
position: absolute;
|
|
content: '';
|
|
top: 50%;
|
|
width: 20px;
|
|
left: -30px;
|
|
border-top: solid 1px var(--borderColor);
|
|
}
|
|
|
|
&:last-child {
|
|
&:before {
|
|
border-bottom-left-radius: 5px;
|
|
border-bottom: solid 1px var(--borderColor);
|
|
bottom: 50%;
|
|
}
|
|
|
|
&:after {
|
|
display: none;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.#{$ns}CBDelete {
|
|
@include icon-color();
|
|
cursor: pointer;
|
|
margin-left: auto;
|
|
transition: opacity 0.2s;
|
|
}
|
|
|
|
.#{$ns}CBGroupOrItem {
|
|
position: relative;
|
|
margin-left: px2rem(30px);
|
|
|
|
& + & {
|
|
margin-top: px2rem(10px);
|
|
}
|
|
|
|
&-body {
|
|
display: flex;
|
|
padding: 2px 7px;
|
|
border-radius: 5px;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
position: relative;
|
|
|
|
background: rgba(0, 0, 0, 0.03);
|
|
transition: all 0.3s ease-out;
|
|
|
|
> .#{$ns}CBGroup {
|
|
margin: 3px;
|
|
}
|
|
}
|
|
|
|
&-body:not(:hover) .#{$ns}CBDelete {
|
|
opacity: 0;
|
|
}
|
|
|
|
&.is-dragging {
|
|
display: none;
|
|
}
|
|
|
|
&.is-ghost > &-body:before {
|
|
position: absolute;
|
|
z-index: 2;
|
|
content: '';
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
background: rgba($info, 0.2);
|
|
}
|
|
|
|
&-dragbar {
|
|
cursor: move;
|
|
width: 20px;
|
|
margin-left: -5px;
|
|
opacity: 0;
|
|
text-align: center;
|
|
transition: opacity 0.3s ease-out;
|
|
@include icon-color();
|
|
}
|
|
|
|
.#{$ns}CBGroup {
|
|
flex-grow: 1;
|
|
}
|
|
|
|
&:hover > &-body {
|
|
background: rgba(0, 0, 0, 0.05);
|
|
}
|
|
|
|
&:hover > &-body > &-dragbar {
|
|
opacity: 1;
|
|
}
|
|
|
|
&:before {
|
|
position: absolute;
|
|
content: '';
|
|
top: -10px;
|
|
left: -30px;
|
|
width: 20px;
|
|
border-left: solid 1px var(--borderColor);
|
|
bottom: 0;
|
|
}
|
|
|
|
&:after {
|
|
position: absolute;
|
|
content: '';
|
|
top: 50%;
|
|
width: 20px;
|
|
left: -30px;
|
|
border-top: solid 1px var(--borderColor);
|
|
}
|
|
|
|
&:last-child {
|
|
&:before {
|
|
border-bottom-left-radius: 5px;
|
|
border-bottom: solid 1px var(--borderColor);
|
|
bottom: 50%;
|
|
}
|
|
|
|
&:after {
|
|
display: none;
|
|
}
|
|
}
|
|
}
|
|
|
|
.#{$ns}CBInputSwitch {
|
|
position: relative;
|
|
display: inline-block;
|
|
vertical-align: middle;
|
|
// margin: px2rem(3px);
|
|
cursor: pointer;
|
|
> a {
|
|
@include icon-color();
|
|
}
|
|
|
|
svg {
|
|
width: px2rem(10px);
|
|
height: px2rem(10px);
|
|
}
|
|
}
|
|
|
|
.#{$ns}CBFunc {
|
|
display: inline-block;
|
|
vertical-align: middle;
|
|
margin: px2rem(3px);
|
|
|
|
&-select {
|
|
display: inline-block;
|
|
position: relative;
|
|
}
|
|
|
|
&-error {
|
|
color: var(--danger);
|
|
}
|
|
|
|
&-args {
|
|
display: inline-block;
|
|
> span {
|
|
display: inline-block;
|
|
padding: 0 5px;
|
|
color: var(--info);
|
|
}
|
|
|
|
> div {
|
|
display: inline-block;
|
|
}
|
|
}
|
|
}
|
|
|
|
.#{$ns}CBValue {
|
|
position: relative;
|
|
display: inline-block;
|
|
vertical-align: middle;
|
|
margin: px2rem(3px);
|
|
}
|
|
|
|
.#{$ns}CBFormula {
|
|
position: relative;
|
|
display: inline-block;
|
|
vertical-align: middle;
|
|
margin: px2rem(3px);
|
|
|
|
&-label {
|
|
background: var(--ResultBox-value-bg);
|
|
color: var(--text--muted-color);
|
|
display: block;
|
|
font-size: var(--fontSizeSm);
|
|
align-self: center;
|
|
margin: -5px 5px -5px -8px;
|
|
padding: 5px;
|
|
border-radius: 5px;
|
|
user-select: none;
|
|
}
|
|
}
|
|
|
|
.#{$ns}CBSeprator {
|
|
width: 20px;
|
|
text-align: center;
|
|
display: inline-block;
|
|
user-select: none;
|
|
}
|