mirror of
https://github.com/tabler/tabler.git
synced 2025-12-23 10:24:24 +04:00
96 lines
2.0 KiB
SCSS
96 lines
2.0 KiB
SCSS
/**
|
|
Image check
|
|
*/
|
|
.imagecheck {
|
|
position: relative;
|
|
margin: 0;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.imagecheck-input {
|
|
position: absolute;
|
|
z-index: -1;
|
|
opacity: 0;
|
|
}
|
|
|
|
.imagecheck-figure {
|
|
position: relative;
|
|
margin: 0;
|
|
border: 1px solid $border-color;
|
|
border-radius: 3px;
|
|
display: flex;
|
|
user-select: none;
|
|
|
|
.imagecheck-input:focus ~ & {
|
|
border-color: $primary;
|
|
box-shadow: $input-btn-focus-box-shadow;
|
|
}
|
|
|
|
.imagecheck-input:checked ~ & {
|
|
border-color: $border-color;
|
|
}
|
|
|
|
&::before {
|
|
position: absolute;
|
|
top: .25rem;
|
|
left: .25rem;
|
|
z-index: 1;
|
|
display: block;
|
|
width: $form-check-input-width;
|
|
height: $form-check-input-width;
|
|
color: #fff;
|
|
pointer-events: none;
|
|
content: "";
|
|
background: $white;
|
|
border: 1px solid $border-color;
|
|
user-select: none;
|
|
border-radius: 3px;
|
|
transition: .3s opacity;
|
|
|
|
.imagecheck-input:checked ~ & {
|
|
background-color: $form-check-input-checked-bg-color;
|
|
background-repeat: $form-check-input-checked-bg-repeat;
|
|
background-position: $form-check-input-checked-bg-position;
|
|
background-size: $form-check-input-checked-bg-size;
|
|
background-image: escape-svg($form-check-input-checked-bg-image);
|
|
border-color: $form-check-input-checked-border-color;
|
|
}
|
|
}
|
|
}
|
|
|
|
.imagecheck-image {
|
|
max-width: 100%;
|
|
opacity: .64;
|
|
transition: .3s opacity;
|
|
|
|
&:first-child {
|
|
border-top-left-radius: 2px;
|
|
border-top-right-radius: 2px;
|
|
}
|
|
|
|
&:last-child {
|
|
border-bottom-right-radius: 2px;
|
|
border-bottom-left-radius: 2px;
|
|
}
|
|
|
|
.imagecheck:hover &,
|
|
.imagecheck-input:focus ~ .imagecheck-figure &,
|
|
.imagecheck-input:checked ~ .imagecheck-figure & {
|
|
opacity: 1;
|
|
}
|
|
}
|
|
|
|
.imagecheck-caption {
|
|
padding: .25rem;
|
|
font-size: $font-size-sm;
|
|
color: $text-muted;
|
|
text-align: center;
|
|
transition: .3s color;
|
|
|
|
.imagecheck:hover &,
|
|
.imagecheck-input:focus ~ .imagecheck-figure &,
|
|
.imagecheck-input:checked ~ .imagecheck-figure & {
|
|
color: $body-color;
|
|
}
|
|
}
|