React with typescript, sass and webpack workign
This commit is contained in:
13
src/App.tsx
Normal file
13
src/App.tsx
Normal file
@ -0,0 +1,13 @@
|
||||
import React from 'react'
|
||||
import "./style.scss"
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<main id="root">
|
||||
<h1>React with Webpack</h1>
|
||||
<div id="container">
|
||||
<div id="box">This box should be centered <br/>(and also this this text)</div>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
12
src/html/template.html
Normal file
12
src/html/template.html
Normal file
@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>React with Webpack</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
5
src/index.tsx
Normal file
5
src/index.tsx
Normal file
@ -0,0 +1,5 @@
|
||||
import * as React from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import App from "./App"
|
||||
|
||||
createRoot(document.querySelector("#root")).render(<App />)
|
31
src/style.scss
Normal file
31
src/style.scss
Normal file
@ -0,0 +1,31 @@
|
||||
$box-background: blue;
|
||||
$container-background: lime;
|
||||
$title-color: cyan;
|
||||
|
||||
main {
|
||||
h1 {
|
||||
color: $title-color;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#container{
|
||||
display: flex;
|
||||
background-color: $container-background;
|
||||
width: 100vw;
|
||||
height: 50vh;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
#box{
|
||||
width: 50%;
|
||||
height: 50%;
|
||||
background-color: $box-background;
|
||||
display: flex;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user