amis/scss/components/form/_fieldset.scss

133 lines
2.2 KiB
SCSS
Raw Normal View History

2019-04-30 11:11:25 +08:00
%fieldSetBase {
2019-12-06 09:58:08 +08:00
position: relative;
&:after {
content: '';
pointer-events: none;
border: 1px solid var(--borderColor);
2019-12-06 09:58:08 +08:00
position: absolute;
z-index: 0;
top: 11px;
left: 0;
bottom: 0;
right: 0;
}
> legend {
position: absolute;
top: 0;
left: 0;
display: inline-block;
border: 0;
width: auto;
z-index: 1;
background: var(--Fieldset-legend-bgColor);
2019-12-06 09:58:08 +08:00
border-left: 0 !important;
}
.collapse {
2019-04-30 11:11:25 +08:00
position: relative;
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
}
fieldset.#{$ns}Collapse {
2019-12-06 09:58:08 +08:00
> legend {
font-weight: var(--fontWeightNormal);
padding: var(--gap-xs) 0;
font-size: var(--fontSizeMd);
color: var(--text--loud-color);
border-left: var(--primary) px2rem(4px) solid;
2019-12-06 09:58:08 +08:00
line-height: 1.2;
2021-04-13 14:17:48 +08:00
margin: var(--gap-base) 0;
2019-12-06 09:58:08 +08:00
padding: 0 0 0 14px;
cursor: pointer;
border-bottom: 0;
2021-07-28 19:12:15 +08:00
display: flex;
flex-direction: row;
justify-content: space-between;
width: 100%;
2019-12-06 09:58:08 +08:00
}
&--xs {
@extend %fieldSetBase;
padding: 20px 5px 5px 5px;
> legend {
left: 5px;
font-size: var(--fontSizeXs);
2019-12-06 09:58:08 +08:00
padding: 0 3px;
margin: 0 0 0 -3px;
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
&:after {
top: 6px;
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&--sm {
@extend %fieldSetBase;
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
padding: 25px 10px 10px 10px;
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
> legend {
left: 10px;
font-size: var(--fontSizeSm);
2019-12-06 09:58:08 +08:00
padding: 0 5px;
margin: 0 0 0 -5px;
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&:after {
top: 6px;
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&--base {
@extend %fieldSetBase;
2019-04-30 11:11:25 +08:00
padding: 30px var(--gap-md) var(--gap-md) var(--gap-md);
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
> legend {
left: var(--gap-md);
font-size: var(--fontSizeBase);
2019-12-06 09:58:08 +08:00
padding: 0 8px;
margin: 0 0 0 -8px;
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&:after {
top: 7px;
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&--md {
@extend %fieldSetBase;
padding: 30px 20px 20px 20px;
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
> legend {
left: 20px;
font-size: var(--fontSizeMd);
2019-12-06 09:58:08 +08:00
padding: 0 10px;
margin: 0 0 0 -10px;
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&:after {
top: 7px;
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&--lg {
@extend %fieldSetBase;
padding: 40px 30px 30px 30px;
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
> legend {
left: 30px;
font-size: var(--fontSizeLg);
padding: 0 var(--gap-md);
margin: 0 0 0 calc(var(--gap-md) * -1);
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&:after {
top: 9px;
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
}
}