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

94 lines
2.9 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-11 14:33:17 +00:00
border-radius: ${dt('fieldset.border.radius')};
color: ${dt('fieldset.color')};
2024-05-11 14:33:17 +00:00
padding: ${dt('fieldset.padding')};
margin: 0;
}
.p-fieldset-legend {
2024-05-04 11:47:06 +00:00
background: ${dt('fieldset.legend.background')};
2024-05-11 14:33:17 +00:00
border-radius: ${dt('fieldset.legend.border.radius')};
border-width: ${dt('fieldset.legend.border.width')};
border-style: solid;
border-color: ${dt('fieldset.legend.border.color')};
padding: ${dt('fieldset.legend.padding')};
transition: background ${dt('fieldset.transition.duration')}, color ${dt('fieldset.transition.duration')}, outline-color ${dt('fieldset.transition.duration')}, box-shadow ${dt('fieldset.transition.duration')};
}
.p-fieldset-toggleable > .p-fieldset-legend {
padding: 0;
}
2024-05-11 14:33:17 +00:00
.p-fieldset-toggle-button {
cursor: pointer;
user-select: none;
overflow: hidden;
position: relative;
text-decoration: none;
display: flex;
2024-05-11 14:33:17 +00:00
gap: ${dt('fieldset.legend.gap')};
align-items: center;
justify-content: center;
2024-05-11 14:33:17 +00:00
padding: ${dt('fieldset.legend.padding')};
background: transparent;
border: 0 none;
2024-05-11 14:33:17 +00:00
border-radius: ${dt('fieldset.legend.border.radius')};
transition: background ${dt('fieldset.transition.duration')}, color ${dt('fieldset.transition.duration')}, outline-color ${dt('fieldset.transition.duration')}, box-shadow ${dt('fieldset.transition.duration')};
outline-color: transparent;
}
.p-fieldset-legend-label {
2024-05-11 14:33:17 +00:00
font-weight: ${dt('fieldset.legend.font.weight')};
}
2024-05-11 14:33:17 +00:00
.p-fieldset-toggle-button:focus-visible {
box-shadow: ${dt('fieldset.legend.focus.ring.shadow')};
outline: ${dt('fieldset.legend.focus.ring.width')} ${dt('fieldset.legend.focus.ring.style')} ${dt('fieldset.legend.focus.ring.color')};
outline-offset: ${dt('fieldset.legend.focus.ring.offset')};
}
2024-05-11 14:33:17 +00:00
.p-fieldset-toggleable > .p-fieldset-legend: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('fieldset.transition.duration')};
}
2024-05-11 14:33:17 +00:00
.p-fieldset-toggleable > .p-fieldset-legend:hover .p-fieldset-toggle-icon {
color: ${dt('fieldset.toggle.icon.hover.color')};
}
.p-fieldset .p-fieldset-content {
2024-05-11 14:33:17 +00:00
padding: ${dt('fieldset.content.padding')};
}
`;
const classes = {
root: ({ props }) => [
'p-fieldset p-component',
{
'p-fieldset-toggleable': props.toggleable
}
],
legend: 'p-fieldset-legend',
legendLabel: 'p-fieldset-legend-label',
2024-05-11 14:33:17 +00:00
toggleButton: 'p-fieldset-toggle-button',
toggleIcon: 'p-fieldset-toggle-icon',
contentContainer: 'p-fieldset-content-container',
content: 'p-fieldset-content'
};
export default BaseStyle.extend({
name: 'fieldset',
theme,
classes
});