adrema/resources/js/composables/useFieldSize.js

27 lines
890 B
JavaScript
Raw Permalink Normal View History

2024-02-02 01:05:45 +01:00
export default function () {
2024-06-28 14:04:20 +02:00
function sizeClass(size) {
return {
sm: 'field-sm',
base: 'field-base',
lg: 'field-lg',
}[size];
}
2024-02-02 01:05:45 +01:00
2024-06-28 13:43:38 +02:00
const fieldHeight = 'group-[.field-base]:h-[35px] group-[.field-sm]:h-[23px]';
const fieldAppearance =
'group-[.field-base]:border-2 group-[.field-sm]:border border-gray-600 border-solid text-gray-300 bg-gray-700 leading-none rounded-lg group-[.field-base]:text-sm group-[.field-sm]:text-xs';
const paddingX = 'group-[.field-base]:px-2 group-[.field-sm]:px-1';
2024-06-28 14:04:20 +02:00
const paddingY = 'group-[.field-base]:py-2 group-[.field-sm]:py-1';
2024-06-28 14:26:12 +02:00
const selectAppearance = 'py-0 pr-8 group-[.field-base]:pl-2 group-[.field-sm]:pl-1 w-full';
2024-02-02 01:05:45 +01:00
return {
2024-06-28 13:43:38 +02:00
fieldHeight,
fieldAppearance,
paddingX,
2024-06-28 14:04:20 +02:00
paddingY,
sizeClass,
2024-06-28 14:26:12 +02:00
selectAppearance,
2024-02-02 01:05:45 +01:00
};
}