primevue-mirror/components/lib/fieldset/style/FieldsetStyle.js

91 lines
2.3 KiB
JavaScript
Raw Normal View History

import BaseStyle from 'primevue/base/style';
const theme = ({ dt }) => `
.p-fieldset {
background: ${dt('fieldset.background')};
border: 1px solid ${dt('fieldset.border.color')};
2024-05-06 21:18:22 +00:00
border-radius: ${dt('border.radius.md')};
color: ${dt('fieldset.color')};
padding: 0 1.125rem 1.125rem 1.125rem;
margin: 0;
}
.p-fieldset-legend {
2024-05-04 11:47:06 +00:00
background: ${dt('fieldset.legend.background')};
border-radius: 6px;
border: 0 none;
padding: 0.5rem 0.75rem;
margin-bottom: 0.375rem;
}
.p-fieldset-toggleable > .p-fieldset-legend {
padding: 0;
}
.p-fieldset-toggleable > .p-fieldset-legend > button {
cursor: pointer;
user-select: none;
overflow: hidden;
position: relative;
text-decoration: none;
display: flex;
gap: 0.5rem;
align-items: center;
justify-content: center;
padding: 0.5rem 0.75rem;
background: transparent;
color: ${dt('fieldset.legend.color')};
border: 0 none;
2024-05-06 21:18:22 +00:00
border-radius: ${dt('border.radius.md')};
transition: background ${dt('transition.duration')}, color ${dt('transition.duration')}, outline-color ${dt('transition.duration')};
outline-color: transparent;
}
.p-fieldset-legend-label {
font-weight: 600;
}
.p-fieldset-toggleable > .p-fieldset-legend > a:focus-visible {
outline: ${dt('focus.ring.width')} ${dt('focus.ring.style')} ${dt('focus.ring.color')};
outline-offset: ${dt('focus.ring.offset')};
}
.p-fieldset-toggleable > .p-fieldset-legend > a:hover {
color: ${dt('fieldset.legend.hover.color')};
background: ${dt('fieldset.legend.hover.background')};
}
.p-fieldset-toggle-icon {
color: ${dt('fieldset.toggle.icon.color')};
transition: color ${dt('transition.duration')};
}
.p-fieldset-toggleable > .p-fieldset-legend > a:hover > .p-fieldset-toggle-icon {
color: ${dt('fieldset.toggle.icon.hover.color')};
}
.p-fieldset .p-fieldset-content {
padding: 0;
}
`;
const classes = {
root: ({ props }) => [
'p-fieldset p-component',
{
'p-fieldset-toggleable': props.toggleable
}
],
legend: 'p-fieldset-legend',
legendLabel: 'p-fieldset-legend-label',
toggleIcon: 'p-fieldset-toggle-icon',
contentContainer: 'p-fieldset-content-container',
content: 'p-fieldset-content'
};
export default BaseStyle.extend({
name: 'fieldset',
theme,
classes
});