How to manage fg/bg color of input widget

I’d like to change the background color of an Input.number field when it’s disabled in an observable framework md file. Should I use something like this or is there another method?

Use CSS?

<style>
form:has([disabled]) {
  background: red;
}

form [disabled] {
  background: green;
}
</style>