Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Calculator app

glowes 50

@glowes

Desktop design screenshot for the Calculator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
3intermediate
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hi there!

I would like to know how to add a gap in between the buttons without affecting to much the 'padding'/position of them , so they could have the same visual style as in the model(smaller and spread).

Also if anyone had add the theme whats the best way to do so? changing the values by theme by adding a new class in Javascript or changing individual html elements.

Thanks in advance, any constructive critics are welcome.

Community feedback

@aUnicornDev

Posted

The reason why you had to use a padding-bottom of 100px on .inputContainer is because the grid is a little defective. You used percentages on your grid-template-rows and columns and a gap of 15px. The percentages would take up the the specified percent width and will not take into account the gap that you set in the grid.

Use this instead:

grid-template-rows: repeat(5,1fr);
grid-template-columns: repeat(4,1fr);

This will create the exact grid you wan as it will take the gap into consideration and hen calculate the value of 1fr(Fractional Unit).

Then you can easily change the whole grid size in order to set the buttons as you like.

For the theme, use CSS variables in defining the basic colors of buttons, background, etc. and change them using JS on change of the theme switch.

Marked as helpful

1

glowes 50

@glowes

Posted

@aUnicornDev Hi there! Thanks for the tips and advice! I will definitely try those!

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord