I'm trying to style input type='date' to take less space, but I can't figure out how to remove the gap between the indicator and the text or how to allow date to be shrunk like a text field.
I've googled for about 3 hours and I've only found this: https://www.tjvantoll.com/2013/04/15/list-of-pseudo-elements-to-style-form-controls/#input_date
Neither of which allows me to remove the gap.
input[type="date"]
{
background: lime;
}
input[type="date"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field,
input[type="date"]::-webkit-calendar-picker-indicator
{
padding: 0;
margin: 0;
}
input[type="date"]::-webkit-inner-spin-button
{
display: none;
}
<html>
<body>
<input type='date' value='2020-04-21'>
</body>
</html>