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-togglebutton {
|
|
|
|
display: inline-flex;
|
|
|
|
user-select: none;
|
|
|
|
vertical-align: bottom;
|
|
|
|
border: 1px solid transparent;
|
2024-03-13 18:50:24 +00:00
|
|
|
background: ${dt('togglebutton.background')};
|
2024-03-12 08:19:23 +00:00
|
|
|
border-radius: ${dt('rounded.base')};
|
2024-02-19 22:53:42 +00:00
|
|
|
outline-color: transparent;
|
|
|
|
position: relative;
|
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
|
|
|
}
|
|
|
|
|
|
|
|
.p-togglebutton-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-12 08:19:23 +00:00
|
|
|
border-radius: ${dt('rounded.base')};;
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-togglebutton .p-button {
|
|
|
|
flex: 1 1 auto;
|
|
|
|
background: transparent;
|
|
|
|
border: 0 none;
|
2024-03-13 18:50:24 +00:00
|
|
|
color: ${dt('togglebutton.item.color')};
|
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;
|
|
|
|
padding: 0.5rem 1rem;
|
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2024-03-12 08:19:23 +00:00
|
|
|
border-radius: ${dt('rounded.base')};
|
2024-02-19 22:53:42 +00:00
|
|
|
gap: 0.5rem;
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-togglebutton .p-button::before {
|
|
|
|
content: "";
|
|
|
|
background: transparent;
|
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
|
|
|
position: absolute;
|
|
|
|
left: 0.25rem;
|
|
|
|
top: 0.25rem;
|
|
|
|
width: calc(100% - 0.5rem);
|
|
|
|
height: calc(100% - 0.5rem);
|
2024-03-13 18:50:24 +00:00
|
|
|
border-radius: ${dt('rounded.sm')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-togglebutton .p-button .p-button-label,
|
|
|
|
.p-togglebutton .p-button .p-button-icon {
|
|
|
|
position: relative;
|
|
|
|
transition: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-togglebutton .p-button .p-button-icon-left,
|
|
|
|
.p-togglebutton .p-button .p-button-icon-right {
|
2024-03-13 18:50:24 +00:00
|
|
|
color: ${dt('togglebutton.item.icon.color')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-togglebutton:not(.p-disabled):has(.p-togglebutton-input:hover):not(.p-highlight) .p-button {
|
2024-03-13 18:50:24 +00:00
|
|
|
color: ${dt('togglebutton.item.hover.color')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-togglebutton:not(.p-disabled):has(.p-togglebutton-input:hover):not(.p-highlight) .p-button .p-button-icon-left,
|
|
|
|
.p-togglebutton:not(.p-disabled):has(.p-togglebutton-input:hover):not(.p-highlight) .p-button .p-button-icon-right {
|
2024-03-13 18:50:24 +00:00
|
|
|
color: ${dt('togglebutton.item.icon.hover.color')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-togglebutton.p-highlight .p-button {
|
2024-03-13 18:50:24 +00:00
|
|
|
color: ${dt('togglebutton.item.checked.color')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-togglebutton.p-highlight .p-button::before {
|
2024-03-13 18:50:24 +00:00
|
|
|
background: ${dt('togglebutton.item.checked.background')};
|
2024-02-19 22:53:42 +00:00
|
|
|
box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.02), 0px 1px 2px 0px rgba(0, 0, 0, 0.04);
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-togglebutton.p-highlight .p-button .p-button-icon-left,
|
|
|
|
.p-togglebutton.p-highlight .p-button .p-button-icon-right {
|
2024-03-13 18:50:24 +00:00
|
|
|
color: ${dt('togglebutton.item.icon.checked.color')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-togglebutton:not(.p-disabled):has(.p-togglebutton-input:focus-visible) {
|
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-togglebutton.p-invalid {
|
2024-03-13 18:50:24 +00:00
|
|
|
border-color: ${dt('togglebutton.invalid.border.color')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-togglebutton.p-disabled {
|
|
|
|
opacity: 1;
|
2024-03-13 18:50:24 +00:00
|
|
|
background: ${dt('togglebutton.disabled.background')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-togglebutton.p-disabled .p-button {
|
2024-03-13 18:50:24 +00:00
|
|
|
color: ${dt('togglebutton.item.disabled.color')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-togglebutton.p-disabled .p-button .p-button-icon {
|
2024-03-13 18:50:24 +00:00
|
|
|
color: ${dt('togglebutton.item.icon.disabled.color')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
`
|
|
|
|
};
|