2024-02-19 22:53:42 +00:00
|
|
|
export default {
|
2024-03-12 08:19:23 +00:00
|
|
|
css: ({ dt }) => `
|
2024-02-19 22:53:42 +00:00
|
|
|
.p-checkbox {
|
|
|
|
position: relative;
|
|
|
|
display: inline-flex;
|
|
|
|
user-select: none;
|
|
|
|
vertical-align: bottom;
|
2024-03-13 11:59:34 +00:00
|
|
|
width: ${dt('checkbox.width')};
|
|
|
|
height: ${dt('checkbox.height')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-checkbox-input {
|
|
|
|
cursor: pointer;
|
|
|
|
appearance: none;
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
|
|
|
opacity: 0;
|
|
|
|
z-index: 1;
|
|
|
|
outline: 0 none;
|
|
|
|
border: 1px solid transparent;
|
2024-03-13 11:59:34 +00:00
|
|
|
border-radius: ${dt('checkbox.border.radius')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-checkbox-box {
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
2024-03-13 11:59:34 +00:00
|
|
|
border-radius: ${dt('checkbox.border.radius')};
|
|
|
|
border: 1px solid ${dt('checkbox.border.color')};
|
|
|
|
background: ${dt('checkbox.background')};
|
|
|
|
width: ${dt('checkbox.width')};
|
|
|
|
height: ${dt('checkbox.width')};
|
2024-03-12 08:19:23 +00:00
|
|
|
transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, border-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')}, outline-color ${dt('transition.duration')};
|
2024-02-19 22:53:42 +00:00
|
|
|
outline-color: transparent;
|
2024-03-13 11:59:34 +00:00
|
|
|
box-shadow: ${dt('checkbox.box.shadow')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-checkbox-icon {
|
2024-03-12 08:19:23 +00:00
|
|
|
transition-duration: ${dt('transition.duration')};
|
2024-03-13 11:59:34 +00:00
|
|
|
color: ${dt('checkbox.icon.color')};
|
|
|
|
font-size: ${dt('checkbox.icon.size')};
|
|
|
|
width: ${dt('checkbox.icon.size')};
|
|
|
|
height: ${dt('checkbox.icon.size')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-checkbox:not(.p-disabled):has(.p-checkbox-input:hover) .p-checkbox-box {
|
2024-03-13 11:59:34 +00:00
|
|
|
border-color: ${dt('checkbox.hover.border.color')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
2024-04-06 20:08:16 +00:00
|
|
|
.p-checkbox-checked .p-checkbox-box {
|
2024-03-13 11:59:34 +00:00
|
|
|
border-color: ${dt('checkbox.checked.border.color')};
|
|
|
|
background: ${dt('checkbox.checked.background')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
2024-04-06 20:08:16 +00:00
|
|
|
.p-checkbox-checked .p-checkbox-icon {
|
2024-03-13 11:59:34 +00:00
|
|
|
color: ${dt('checkbox.icon.checked.color')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
2024-04-06 20:08:16 +00:00
|
|
|
.p-checkbox-checked:not(.p-disabled):has(.p-checkbox-input:hover) .p-checkbox-box {
|
2024-03-13 11:59:34 +00:00
|
|
|
background: ${dt('checkbox.checked.hover.background')};
|
|
|
|
border-color: ${dt('checkbox.checked.hover.border.color')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
2024-04-06 20:08:16 +00:00
|
|
|
.p-checkbox-checked:not(.p-disabled):has(.p-checkbox-input:hover) .p-checkbox-icon {
|
2024-03-13 11:59:34 +00:00
|
|
|
color: ${dt('checkbox.icon.checked.hover.color')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-checkbox:not(.p-disabled):has(.p-checkbox-input:focus-visible) .p-checkbox-box {
|
2024-03-12 08:19:23 +00:00
|
|
|
outline: ${dt('focus.ring.width')} ${dt('focus.ring.style')} ${dt('focus.ring.color')};
|
|
|
|
outline-offset: ${dt('focus.ring.offset')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-checkbox.p-invalid > .p-checkbox-box {
|
2024-03-13 11:59:34 +00:00
|
|
|
border-color: ${dt('checkbox.invalid.border.color')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-checkbox.p-variant-filled .p-checkbox-box {
|
2024-04-06 20:08:16 +00:00
|
|
|
background: ${dt('checkbox.filled.background')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
2024-04-06 20:08:16 +00:00
|
|
|
.p-checkbox-checked.p-variant-filled .p-checkbox-box {
|
2024-03-13 11:59:34 +00:00
|
|
|
background: ${dt('checkbox.checked.background')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
2024-04-06 20:08:16 +00:00
|
|
|
.p-checkbox-checked.p-variant-filled:not(.p-disabled):has(.p-checkbox-input:hover) .p-checkbox-box {
|
2024-03-13 11:59:34 +00:00
|
|
|
background: ${dt('checkbox.checked.hover.background')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-checkbox.p-disabled {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-checkbox.p-disabled .p-checkbox-box {
|
2024-03-13 11:59:34 +00:00
|
|
|
background: ${dt('checkbox.disabled.background')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-checkbox.p-disabled .p-checkbox-box .p-checkbox-icon {
|
2024-03-13 11:59:34 +00:00
|
|
|
color: ${dt('checkbox.icon.disabled.color')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
`
|
|
|
|
};
|