primevue-mirror/components/lib/textarea/style/TextareaStyle.js

81 lines
2.2 KiB
JavaScript
Raw Normal View History

import BaseStyle from 'primevue/base/style';
const theme = ({ dt }) => `
2024-05-22 08:11:33 +00:00
.p-textarea {
font-family: inherit;
font-feature-settings: inherit;
font-size: 1rem;
color: ${dt('textarea.color')};
background: ${dt('textarea.background')};
2024-05-06 21:33:13 +00:00
padding: ${dt('textarea.padding.y')} ${dt('textarea.padding.x')};
border: 1px solid ${dt('textarea.border.color')};
2024-05-26 21:38:39 +00:00
transition: background ${dt('textarea.transition.duration')}, color ${dt('textarea.transition.duration')}, border-color ${dt('textarea.transition.duration')}, outline-color ${dt('textarea.transition.duration')}, box-shadow ${dt(
'textarea.transition.duration'
)};
appearance: none;
2024-05-06 21:33:13 +00:00
border-radius: ${dt('textarea.border.radius')};
outline-color: transparent;
2024-05-06 21:23:42 +00:00
box-shadow: ${dt('textarea.shadow')};
}
2024-05-22 08:11:33 +00:00
.p-textarea:enabled:hover {
border-color: ${dt('textarea.hover.border.color')};
}
2024-05-22 08:11:33 +00:00
.p-textarea:enabled:focus {
border-color: ${dt('textarea.focus.border.color')};
box-shadow: ${dt('textarea.focus.ring.shadow')};
outline: ${dt('textarea.focus.ring.width')} ${dt('textarea.focus.ring.style')} ${dt('textarea.focus.ring.color')};
outline-offset: ${dt('textarea.focus.ring.offset')};
}
2024-05-22 08:11:33 +00:00
.p-textarea.p-invalid {
border-color: ${dt('textarea.invalid.border.color')};
}
2024-05-22 08:11:33 +00:00
.p-textarea.p-variant-filled {
background: ${dt('textarea.filled.background')};
}
2024-05-22 08:11:33 +00:00
.p-textarea.p-variant-filled:enabled:focus {
background: ${dt('textarea.filled.focus.background')};
}
2024-05-22 08:11:33 +00:00
.p-textarea:disabled {
opacity: 1;
background: ${dt('textarea.disabled.background')};
color: ${dt('textarea.disabled.color')};
}
2024-05-22 08:11:33 +00:00
.p-textarea::placeholder {
color: ${dt('textarea.placeholder.color')};
}
2024-05-22 08:11:33 +00:00
.p-fluid .p-textarea {
width: 100%;
}
2024-05-22 08:11:33 +00:00
.p-textarea-resizable {
overflow: hidden;
resize: none;
}
`;
const classes = {
root: ({ instance, props }) => [
2024-05-22 08:11:33 +00:00
'p-textarea p-component',
{
'p-filled': instance.filled,
2024-05-22 08:11:33 +00:00
'p-textarea-resizable ': props.autoResize,
2024-01-31 08:02:53 +00:00
'p-invalid': props.invalid,
2024-02-02 11:46:26 +00:00
'p-variant-filled': props.variant ? props.variant === 'filled' : instance.$primevue.config.inputStyle === 'filled'
}
]
};
export default BaseStyle.extend({
name: 'textarea',
theme,
classes
});