Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted almost 3 years ago

Calculator app using grid and SCSS

sass/scss
Stephan Ullmann•80
@StephanUllmann
A solution to the Calculator app challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I had problems centering the calculator vertically on small screens. Using 100svh didn't work, so I finally used Javascript to determine the user's window height. Is there a good solution in CSS?

Also I am uncomfortable with my code organisation. Should a shorter script like that use classes (or one class) already? And it seems overly complicated. At last I decided to perform the actual calculation inside a while loop do do a chain of arithmetical operation in the right order. Are there any more elegant solutions, e.g. a way to use array methods for this? And if - how?

Thank you for any suggestions!

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Stephan Ullmann's solution.

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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner
  • Use cases

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License