Button (Not ready)

This commit is contained in:
brausjonas
2023-04-27 16:58:50 +02:00
parent 540b15c0b0
commit 1d087d7996
5 changed files with 41 additions and 52 deletions
+3
View File
@@ -15,6 +15,9 @@
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-scripts": "5.0.1", "react-scripts": "5.0.1",
"web-vitals": "^2.1.4" "web-vitals": "^2.1.4"
},
"devDependencies": {
"tailwindcss": "^3.3.2"
} }
}, },
"node_modules/@adobe/css-tools": { "node_modules/@adobe/css-tools": {
+3
View File
@@ -34,5 +34,8 @@
"last 1 firefox version", "last 1 firefox version",
"last 1 safari version" "last 1 safari version"
] ]
},
"devDependencies": {
"tailwindcss": "^3.3.2"
} }
} }
+13 -33
View File
@@ -1,38 +1,18 @@
.App {
text-align: center;
.round-border-10
{
border-radius: 10px;
border-width: 0;
} }
.App-logo { .default-button
height: 40vmin; {
pointer-events: none; background-color: #0d52ce;
color: #ffffff;
} }
@media (prefers-reduced-motion: no-preference) { .font-middle
.App-logo { {
animation: App-logo-spin infinite 20s linear; font-size: 20px ;
}
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
} }
+2 -14
View File
@@ -1,23 +1,11 @@
import logo from './logo.svg'; import logo from './logo.svg';
import './App.css'; import './App.css';
import Button from "./components/Button";
function App() { function App() {
return ( return (
<div className="App"> <div className="App">
<header className="App-header"> <Button text={"Test"} PaddingX={20} PaddingY={10}/>
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div> </div>
); );
} }
+15
View File
@@ -0,0 +1,15 @@
import "../App.css"
export default function Button(p) {
return (
<button className={"default-button round-border-10 font font-middle"}
style={{
paddingTop: p.PaddingY,
paddingBottom: p.PaddingY,
paddingLeft: p.PaddingX,
paddingRight: p.PaddingX
}}>{p.text}</button>
);
}