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

72 lines
1.6 KiB
SCSS
Raw Normal View History

2018-05-17 04:44:58 +00:00
/** @format */
.woocommerce-segmented-selection {
2018-05-17 04:44:58 +00:00
width: 100%;
2018-06-29 00:34:17 +00:00
color: $core-grey-dark-500;
2018-05-28 10:55:19 +00:00
}
.woocommerce-segmented-selection__container {
width: 100%;
2018-05-17 04:44:58 +00:00
grid-template-columns: 1fr 1fr;
display: grid;
2018-06-29 00:34:17 +00:00
border-top: 1px solid $core-grey-light-700;
border-bottom: 1px solid $core-grey-light-700;
2018-05-17 04:44:58 +00:00
grid-gap: 1px;
2018-06-29 00:34:17 +00:00
background-color: $core-grey-light-700;
2018-05-17 04:44:58 +00:00
}
.woocommerce-segmented-selection__label {
2018-06-29 00:34:17 +00:00
background-color: $core-grey-light-100;
padding: 12px 12px 12px 24px;
2018-05-17 04:44:58 +00:00
position: relative;
display: block;
height: 100%;
2018-06-29 00:34:17 +00:00
&:active {
background-color: $core-grey-light-200;
2018-06-29 00:34:17 +00:00
}
&:hover {
background-color: $core-grey-light-200;
}
2018-05-17 04:44:58 +00:00
}
.woocommerce-segmented-selection__input {
2018-05-17 04:44:58 +00:00
opacity: 0;
position: absolute;
left: -9999px;
2018-06-29 00:34:17 +00:00
&:active + label .woocommerce-segmented-selection__label {
background-color: $core-grey-light-200;
2018-06-29 00:34:17 +00:00
}
&:checked + label .woocommerce-segmented-selection__label {
2018-06-29 00:34:17 +00:00
background-color: $white;
2018-05-17 04:44:58 +00:00
&::before {
content: '';
width: 8px;
height: 8px;
2018-06-29 00:34:17 +00:00
background-color: $woocommerce;
2018-05-17 04:44:58 +00:00
position: absolute;
top: 50%;
2018-06-29 00:34:17 +00:00
transform: translate(-16px, -50%);
2018-05-17 04:44:58 +00:00
}
}
&:focus + label .woocommerce-segmented-selection__label {
2018-06-29 00:34:17 +00:00
/**
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);
2018-05-17 04:44:58 +00:00
}
}