Vuepic / vue-datepicker

Datepicker component for Vue 3
https://vue3datepicker.com
MIT License
1.43k stars 142 forks source link

Style of input placeholder does not change #815

Closed jduncanRadBlue closed 5 months ago

jduncanRadBlue commented 5 months ago

Describe the bug Trying to change the color of the input placeholder and it doesn't change. The color only applies to the value of the date selected, not the placeholder text.

To Reproduce

<VueDatePicker
  class="mt-2"
  :state="dateValid"
  placeholder="Select Start Date"
  input-class-name="dp-custom-input"
  :min-date="new Date()"
  v-model="request.startTime"
  @update:model-value="checkDateValid"
  :dark="theme.global.current.value.dark"
></VueDatePicker>

custom style:

<style lang="scss">
.dp-custom-input {
  box-shadow: 0 0 6px #1976d2;
  color: #1976d2;

  &:hover {
    border-color: #1976d2;
  }
}
</style>

Is there a way to style the input's placeholder text?

Jasenkoo commented 5 months ago

This is a css question, but to style placeholder, you need to actually use a placeholder selector

&::placeholder {
   color: #1976d2;
}

specifically


.dp-custom-input {
    box-shadow: 0 0 6px #1976d2;
    color: #1976d2;

    &::placeholder {
        color: #1976d2;
    }

    &:hover {
        border-color: #1976d2;
    }
}