I have a vanilla JS project which I tried to implement in react. The HTML/JSX of both are same and also the stylesheet are same only difference being the entire html for vanilla JS being written in a single index.html file
<body>
<header>
<h1>Todo app</h1>
</header>
<form>
<input type="text" class="todo-input" />
<button class="todo-button" type="submit">
<i class="fas fa-plus-square"></i>
</button>
<div class="select">
<select name="todos" class="filter-todo">
<option value="all">All</option>
<option value="completed">Completed</option>
<option value="uncompleted">Uncompleted</option>
</select>
</div>
</form>
<script src="./app.js"></script>
</body>
and for React JS they are distributed into two files the App.JS
import React from "react";
import './App.css';
//importing components
import Form from "./components/Form";
function App() {
return (
<div className="App">
<header>
<h1>Todo app</h1>
</header>
<Form />
</div>
);
}
export default App;
and a component file Form.js
import React from "react";
const Form = () =>{
return(
<form>
<input type="text" className="todo-input" />
<button className="todo-button" type="submit">
<i className="fas fa-plus-square"></i>
</button>
<div className="select">
<select name="todos" className="filter-todo">
<option value="all">All</option>
<option value="completed">Completed</option>
<option value="uncompleted">Uncompleted</option>
</select>
</div>
</form>
);
}
export default Form;
The relevant CSS portion
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background-image: linear-gradient(120deg, #f6d365 0%, #fda085 100%);
color: white;
font-family: "Poppins", sans-serif;
min-height: 100vh;
}
header {
font-size: 2rem;
}
header,
form {
min-height: 20vh;
display: flex;
justify-content: center;
align-items: center;
}
form input,
form button {
padding: 0.5rem;
font-size: 2rem;
border: none;
background: white;
}
form button {
color: #ff6f47;
background: #f7fffe;
cursor: pointer;
transition: all 0.3s ease;
}
form button:hover {
background: #ff6f47;
color: white;
}
However, the React output seems to override the CSS

and doesn't interpret the CSS as in a html file for the vanilla project

Please help me out to understand this strange behavior of React compiler.