woocommerce/plugins/woocommerce-blocks/assets/js/base/components/radio-control/_mixin.scss

97 lines
2.0 KiB
SCSS
Raw Normal View History

@mixin radio-control-styles {
.wc-block-radio-control__option {
border-bottom: 1px solid $core-grey-light-600;
display: block;
padding: $gap-small $gap-small 0 #{$gap-larger * 2};
position: relative;
}
.wc-block-radio-control__option-layout {
border-bottom: 1px solid $core-grey-light-600;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
padding-bottom: $gap-small;
}
.wc-block-radio-control__option .wc-block-radio-control__option-layout {
border-bottom: 0;
}
.wc-block-radio-control__input {
left: $gap-large;
position: absolute;
top: $gap-small;
}
.wc-block-radio-control__label,
.wc-block-radio-control__secondary-label {
line-height: 20px;
// Currently, max() CSS function calls need to be wrapped with unquote.
// See: https://github.com/sass/sass/issues/2378#issuecomment-367490840
line-height: unquote("max(1rem, 20px)");
color: $core-grey-dark-600;
flex-basis: 50%;
}
.wc-block-radio-control__description,
.wc-block-radio-control__secondary-description {
font-size: 0.875em;
line-height: 20px;
color: $core-grey-dark-400;
flex-basis: 50%;
}
.wc-block-radio-control__secondary-label,
.wc-block-radio-control__secondary-description {
text-align: right;
}
}
@mixin radio-control-input-styles {
.wc-block-radio-control__input {
appearance: none;
background: #fff;
border: 2px solid currentColor;
border-radius: 50%;
display: inline-block;
height: 1.25rem;
min-height: 20px;
min-width: 20px;
width: 1.25rem;
&:checked::before {
background: currentColor;
border-radius: 50%;
content: "";
display: block;
height: 0.625em;
left: 50%;
margin: 0;
min-height: 10px;
min-width: 10px;
position: absolute;
top: 50%;
transform: translate(-50%, -50%);
width: 0.625em;
}
}
@include breakpoint( ">782px" ) {
.wc-block-radio-control__input {
height: 1rem;
margin-top: 2px;
min-height: 16px;
min-width: 16px;
width: 1rem;
&:checked::before {
height: 0.5em;
min-height: 8px;
min-width: 8px;
width: 0.5em;
}
}
}
}