Hi,
I’m working on the calculator project and the react / js part is done but I have a problem with CSS - when I type a lot of digits the display screen and the buttons automatically extend and get outside of the container. Please see the picture. I don’t know how to fix it and make the font-size automatically smaller when the numbers don’t fit.
Can someone please help?
CSS:
.Layout {
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background-image: linear-gradient(to right, #8360c3, #2ebf91);
@media (max-width: 414px) {
background: none;
}
}
.container {
position: relative;
width: 350px;
height: calc(100vh - 45%);
padding: 2rem;
display: grid;
grid-template-rows: 25% auto;
font-size: 1.75rem;
color: #333;
background-color: $dark-grey;
border-radius: 1rem;
box-shadow: 1.5rem 1.5rem 4rem -0.8rem rgba(0, 0, 0, 0.75);
}
.top {
background-color: $display;
}
.middle {
display: grid;
grid-template-rows: repeat(5, 1fr);
grid-template-columns: repeat(4, 1fr);
position: relative;
padding: 10px 0;
z-index: 100;
}
}
Thank you!