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;
|
2024-03-25 21:11:32 +00:00
|
|
|
cursor: pointer;
|
2024-02-19 22:53:42 +00:00
|
|
|
user-select: none;
|
2024-03-25 21:11:32 +00:00
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
overflow: hidden;
|
|
|
|
position: relative;
|
|
|
|
color: ${dt('togglebutton.color')};
|
2024-03-13 18:50:24 +00:00
|
|
|
background: ${dt('togglebutton.background')};
|
2024-03-25 21:11:32 +00:00
|
|
|
border: 1px solid ${dt('togglebutton.border.color')};
|
|
|
|
padding: 0.5rem 1rem;
|
|
|
|
font-size: 1rem;
|
|
|
|
transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, border-color ${dt('transition.duration')}, outline-color ${dt('transition.duration')};
|
2024-03-12 08:19:23 +00:00
|
|
|
border-radius: ${dt('rounded.base')};
|
2024-02-19 22:53:42 +00:00
|
|
|
outline-color: transparent;
|
2024-03-25 21:11:32 +00:00
|
|
|
gap: 0.5rem;
|
|
|
|
font-weight: 500;
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
2024-03-25 21:11:32 +00:00
|
|
|
.p-togglebutton-label,
|
|
|
|
.p-togglebutton-icon {
|
2024-02-19 22:53:42 +00:00
|
|
|
position: relative;
|
2024-03-25 21:11:32 +00:00
|
|
|
transition: none;
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
2024-03-25 21:11:32 +00:00
|
|
|
.p-togglebutton::before {
|
2024-02-19 22:53:42 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2024-04-07 10:58:33 +00:00
|
|
|
.p-togglebutton.p-togglebutton-checked::before {
|
2024-03-25 21:11:32 +00:00
|
|
|
background: ${dt('togglebutton.checked.background')};
|
|
|
|
box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.02), 0px 1px 2px 0px rgba(0, 0, 0, 0.04);
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
2024-04-07 10:58:33 +00:00
|
|
|
.p-togglebutton:not(:disabled):not(.p-togglebutton-checked):hover {
|
2024-03-25 21:11:32 +00:00
|
|
|
color: ${dt('togglebutton.hover.color')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
2024-04-07 10:58:33 +00:00
|
|
|
.p-togglebutton.p-togglebutton-checked {
|
2024-03-25 21:11:32 +00:00
|
|
|
color: ${dt('togglebutton.checked.color')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
2024-03-25 21:11:32 +00:00
|
|
|
.p-togglebutton: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
|
|
|
}
|
|
|
|
|
2024-03-25 21:11:32 +00:00
|
|
|
.p-togglebutton:disabled {
|
2024-02-19 22:53:42 +00:00
|
|
|
opacity: 1;
|
2024-04-02 08:57:41 +00:00
|
|
|
cursor: default;
|
2024-03-13 18:50:24 +00:00
|
|
|
background: ${dt('togglebutton.disabled.background')};
|
2024-04-02 08:57:41 +00:00
|
|
|
border-color: ${dt('togglebutton.disabled.border.color')};
|
2024-03-25 21:11:32 +00:00
|
|
|
color: ${dt('togglebutton.disabled.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-togglebutton-icon {
|
|
|
|
color: ${dt('togglebutton.icon.color')};
|
|
|
|
}
|
|
|
|
|
2024-04-07 10:58:33 +00:00
|
|
|
.p-togglebutton:not(:disabled):not(.p-togglebutton-checked):hover .p-togglebutton-icon {
|
2024-03-25 21:11:32 +00:00
|
|
|
color: ${dt('togglebutton.icon.hover.color')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
2024-04-07 10:58:33 +00:00
|
|
|
.p-togglebutton.p-togglebutton-checked .p-togglebutton-icon {
|
2024-03-25 21:11:32 +00:00
|
|
|
color: ${dt('togglebutton.icon.checked.color')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
2024-03-25 21:11:32 +00:00
|
|
|
.p-togglebutton:disabled .p-togglebutton-icon {
|
|
|
|
color: ${dt('togglebutton.icon.disabled.color')};
|
2024-02-19 22:53:42 +00:00
|
|
|
}
|
|
|
|
`
|
|
|
|
};
|