I'm brand new to React and I'm currently in the process of converting a pure HTML page into a React component. How can I adjust the SASS stylesheet to match the original HTML layout?
Here is my current React setup (the checkbox displays on the right instead of the left, and the alignment between the checkbox and labels is off):
This is how it looked in HTML, which is the desired format:
checkbox.component.jsx
import React from "react";
import './checkbox.styles.scss'
const Checkbox = ({ label, isSelected, onCheckboxChange }) => (
<div className="form-check">
<li>
<label for={label}> {label} </label>
<input
type="checkbox"
name={label}
id={label}
value={label}
checked={isSelected}
onChange={onCheckboxChange}
/>
</li>
</div>
);
export default Checkbox;
checkbox.styles.scss
.form-check{
li{
list-style: none;
margin-left: 15px;
text-align:left;
}
label{
cursor: pointer;
}
label:hover{
background-color:linen;
text-decoration:underline;
}
}