mardi 6 juillet 2021

How to change React Bootstrap Checkbox Background Color

I want to change the background color of this checkbox, but nothing I try seems to work.

This is the Checkbox:

import { useState } from "react";
import { Form } from "react-bootstrap";

const Checkbox = ({disabled} :any) => {
  const [checked, setChecked] = useState(false);
  return (
    <>
      <Form.Group style=>
        <input
          type="checkbox"
          defaultChecked={checked}
          onChange={() => setChecked(true)}
          className="checkbox"
          style=
          disabled={disabled}
        />
      </Form.Group>
    </>
  );
};

export default Checkbox;

This is the CSS:

input[type="checkbox"] {
  cursor: pointer;
  width: 25px;
  height: 25px;
  float: right;
  background-color: #ffdd20 !important;
}

And this is the result: Checkbox




Aucun commentaire:

Enregistrer un commentaire