Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Styling of react calculator #144

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 28 additions & 16 deletions react-calculator/src/App.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
.App {
text-align: center;
margin-top: 10rem;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

.App-logo {
Expand Down Expand Up @@ -37,12 +42,33 @@
}
}

.calculator-container {
background-color: #cecece;
border-radius:5%;
width: 35vh;
padding: 1rem;
display: flex;
flex-direction: column;
align-items: center;
}

.display-container {
width: 80%;
}

.display-container p {
background-color: #fffbe4;
height: 3rem;
font-size: 2rem;
}

.buttons-container {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-auto-rows: 50px;
border: 2px solid black;
margin: 0rem 5rem;
padding: 1rem;
border: 1px solid black;
border-radius: 5%;
gap: 5px;
}

Expand All @@ -52,18 +78,4 @@

.equal-button {
grid-row: span 2;
}

/* Display */

/* .display-container {
color: white;
border: 2px solid green;
} */

.display-container p {
border: 2px solid blue;
height: 1.5rem;
margin: 0rem 5rem;
margin-bottom: 1rem;
}
9 changes: 4 additions & 5 deletions react-calculator/src/components/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { ReactNode } from "react";

interface LayoutProps {
children: ReactNode,
className?: string
}
children: ReactNode
}

const Layout = ({children, className=""}: LayoutProps) => {
const Layout = ({children}: LayoutProps) => {
return (
<div className={`${className}`} style={{border:'2px solid blue', padding: '1rem 0rem', margin:'0rem 25rem'}}>
<div className="calculator-container">
{children}
</div>
)
Expand Down