primevue-mirror/components/lib/themes/primeone/base/floatlabel/index.js

58 lines
1.4 KiB
JavaScript
Raw Normal View History

2024-02-22 14:19:45 +00:00
export default {
css: ({ dt }) => `
2024-02-22 14:19:45 +00:00
.p-float-label {
display: block;
position: relative;
}
.p-float-label label {
position: absolute;
pointer-events: none;
top: 50%;
margin-top: -.5rem;
transition-property: all;
transition-timing-function: ease;
line-height: 1;
left: 0.75rem;
2024-03-13 18:50:24 +00:00
color: ${dt('floatlabel.color')};
transition-duration: ${dt('transition.duration')};
2024-02-22 14:19:45 +00:00
}
.p-float-label:has(textarea) label {
top: 1rem;
}
.p-float-label:has(input:focus) label,
.p-float-label:has(input.p-filled) label,
.p-float-label:has(input:-webkit-autofill) label,
.p-float-label:has(textarea:focus) label,
.p-float-label:has(textarea.p-filled) label,
.p-float-label:has(.p-inputwrapper-focus) label,
.p-float-label:has(.p-inputwrapper-filled) label {
top: -.75rem;
font-size: 12px;
2024-03-13 18:50:24 +00:00
color: ${dt('floatlabel.focus.color')};
2024-02-22 14:19:45 +00:00
}
.p-float-label .p-placeholder,
.p-float-label input::placeholder,
.p-float-label .p-inputtext::placeholder {
opacity: 0;
transition-property: all;
transition-timing-function: ease;
}
.p-float-label .p-focus .p-placeholder,
.p-float-label input:focus::placeholder,
.p-float-label .p-inputtext:focus::placeholder {
opacity: 1;
transition-property: all;
transition-timing-function: ease;
}
.p-float-label > .p-invalid + label {
2024-03-13 18:50:24 +00:00
color: ${dt('floatlabel.invalid.color')};
2024-02-22 14:19:45 +00:00
}
`
};