woocommerce/plugins/woocommerce-admin/client/components/segmented-selection/style.scss

72 lines
1.6 KiB
SCSS

/** @format */
.woocommerce-segmented-selection {
width: 100%;
color: $core-grey-dark-500;
}
.woocommerce-segmented-selection__container {
width: 100%;
grid-template-columns: 1fr 1fr;
display: grid;
border-top: 1px solid $core-grey-light-700;
border-bottom: 1px solid $core-grey-light-700;
grid-gap: 1px;
background-color: $core-grey-light-700;
}
.woocommerce-segmented-selection__label {
background-color: $core-grey-light-100;
padding: 12px 12px 12px 24px;
position: relative;
display: block;
height: 100%;
&:active {
background-color: $core-grey-light-200;
}
&:hover {
background-color: $core-grey-light-200;
}
}
.woocommerce-segmented-selection__input {
opacity: 0;
position: absolute;
left: -9999px;
&:active + label .woocommerce-segmented-selection__label {
background-color: $core-grey-light-200;
}
&:checked + label .woocommerce-segmented-selection__label {
background-color: $white;
&::before {
content: '';
width: 8px;
height: 8px;
background-color: $woocommerce;
position: absolute;
top: 50%;
transform: translate(-16px, -50%);
}
}
&:focus + label .woocommerce-segmented-selection__label {
/**
Must use outline instead of border here to avoid having the
elements below shift by 2 pixel on focus. This trickery is needed
so that left and right edges can be seen as those borders are actually
part of the parent CSS grid.
*/
outline: 1px solid $black;
width: calc(100% - 1px);
}
&:nth-child(4n + 1):focus + label .woocommerce-segmented-selection__label {
transform: translateX(1px);
}
}