lightning-input type = "date" picker's hover and active states to be darker color for WCAG <lightning-input name="dob" class="validate dob" type="date" label="Date of Birth (mm/dd/yyyy) value="person.dob" date-style="short" onChange="checkDatesDOB" required
for the above date picker we need to apply dark background on the dates and month arrows (around the month) when hovered over or clicked on for accessibility. Can someone help how to style the above requirement. Some articles say we need build custom date picker from scratch .. how to go about it ?
Or I read on here we can use loadStyle as static resource and then apply styles for inside levels .. I am not sure how the inside tags of date picker look like after clicking to bring up the date picker. Can you help with simple example using the loadStyles method or the other where a child style element is inserted below link
https://hellosnl.blogspot.com/2019/07/lwc-override-css-of-standard-lightning-components.html I appreciate your time and help
Might help someone .. I found 2 ways to solve it based on this blog post - https://hellosnl.blogspot.com/2019/07/lwc-override-css-of-standard-lightning-components.html
create a style element, assign style class body, the appendChild in the DOM
renderedCallback() {
const style = document.createElement('style');
style.innerText = c-hello-expressions .slds-card__header { background-color: #54C2B2; }
;
this.template.querySelector('lightning-card').appendChild(style);
}
loadStyles using the code in the blogpost above.
I also had asked for help on changing the date format of lightning input control and the solutions are -
But I wanted 'mm/dd/yyyy' and another way is to use - 2. use standard html input control of type = "date" Example:
<label class="slds-form-element__label" for="date-input-id-default">Date</label>
<input type="date" id="start" name="trip-start"
value="2018-07-22" class="slds-input"
min="2018-01-01" max="2018-12-31">