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-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
"devDependencies": {
"tailwindcss": "^3.3.2"
}
},
"node_modules/@adobe/css-tools": {
+3
View File
@@ -34,5 +34,8 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"tailwindcss": "^3.3.2"
}
}
+14 -34
View File
@@ -1,38 +1,18 @@
.App {
text-align: center;
.round-border-10
{
border-radius: 10px;
border-width: 0;
}
.App-logo {
height: 40vmin;
pointer-events: none;
.default-button
{
background-color: #0d52ce;
color: #ffffff;
}
@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}
.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);
}
}
.font-middle
{
font-size: 20px ;
}
+6 -18
View File
@@ -1,25 +1,13 @@
import logo from './logo.svg';
import './App.css';
import Button from "./components/Button";
function App() {
return (
<div className="App">
<header className="App-header">
<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>
);
return (
<div className="App">
<Button text={"Test"} PaddingX={20} PaddingY={10}/>
</div>
);
}
export default App;
+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>
);
}