Here's a clean, custom CSS implementation to style the input element while preserving the intended design from your Tailwind classes:
/* Base Input Styling */
.delete-confirm-input {
width: 100%;
padding: 0.375rem; /* tw-p-1.5 */
border-radius: 0.375rem; /* tw-rounded-md */
border: 1px solid #e5e7eb; /* tw-border (Tailwind's gray-200) */
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1),
0 1px 2px 0 rgba(0, 0, 0, 0.06); /* tw-shadow */
outline: none; /* tw-outline-none */
box-sizing: border-box; /* Ensure padding doesn't expand width */
font-size: 1rem; /* Adjust based on your design system */
transition: all 0.2s ease-in-out;
}
/* Focus state styling */
.delete-confirm-input:focus {
border-color: #3b82f6; /* Tailwind's blue-500 */
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); /* Focus ring */
}
/* Disabled state styling (optional) */
.delete-confirm-input:disabled {
opacity: 0.6;
cursor: not-allowed;
}
How to Apply:
Update your input element by replacing the Tailwind classes with a class="delete-confirm-input" attribute:
<input
v-model="deleteConfirmText"
autofocus
class="delete-confirm-input"
/>
Explanation:
- Width & Padding: Ensures full width with consistent spacing.
- Border & Shadow: Mimics Tailwind's default border and shadow styles.
- Focus State: Enhances usability with a visible focus indicator.
- Box Sizing: Prevents layout shifts when padding is applied.
- Transition: Adds smooth interaction feedback.
This approach removes Tailwind dependencies while maintaining a clean, modern UI. You can further customize colors and transitions to match your design system.