I’m trying to change the background colours of <fluent-select>
and <fluent-option>
elements in CSS. Preferably, I’d use no JavaScript (I want the solution to be as simple as possible) and no React (I’m not set up with it). I want to change it to the “accent” appearance, which is a blue by default or change it to a custom colour. This is the code I’m using to create the select component:
<fluent-select title="Select a page to navigate to">
<fluent-option value="1" onclick="console.info('Beginning clicked.')">Beginning</fluent-option>
<fluent-option value="2">Middle</fluent-option>
<fluent-option value="3">End</fluent-option>
</fluent-select>
I tried this CSS code to change the colour:
fluent-select {
background-color: red;
}
This turned the element’s colour red while the page was loading, but then turned back to white. Somehow, I’m able to change the font colour with color: #FFFFF;
but not the background colour. Is this even possible?