bootstrap-dark-5 icon indicating copy to clipboard operation
bootstrap-dark-5 copied to clipboard

Updating input[type="date] calendar when dark mode activated

Open pamgaiguer opened this issue 2 years ago • 2 comments

hey guys, I was using the library and found an update that could be done :

image

image

I had to use this block of code to update the calendar icon :

  input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    border-radius: 4px;
    margin-right: 2px;
    opacity: 0.6;
    filter: invert(0.8);
  }

  input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
  }

pamgaiguer avatar Mar 16 '22 00:03 pamgaiguer

This is a good catch - but Bootstrap (core) does not provide input CSS styling to input[type="date"] types.

The code you provide would be "in addition" to core - something I've tried to stay away from. i.e. something that should be submitted to core (i.e. the twbs/bootstrap project) not this PoC.

(Then again I do have the dark/_patch.scss file - so that would be hypocritical of me not consider this.)

This is IMO a "bug" that will need to be addressed tho ...

image

From what I can see right now this is not only a date type issue either ... there are also:

<input type="date">
<input type="datetime-local">
<input type="month">
<input type="time">
<input type="week">

Also, from what I can see this is a Chrome/Edge specific issue too as Safari and FF don't display the icon - In your experience, have you tested this across all the browsers to see if it's an issue with non-webkit browsers? (I've only tested on a 2013 iMac)

vinorodrigues avatar Mar 18 '22 13:03 vinorodrigues

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date
https://dev.to/codeclown/styling-a-native-date-input-into-a-custom-no-library-datepicker-2in

vinorodrigues avatar Mar 18 '22 14:03 vinorodrigues