Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 12 months ago

Next.js Calculator

next, react, tailwind-css
Ehsan•210
@Ehsan-eslami
A solution to the Calculator app challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

What I Am Most Proud Of?

  1. User-Centric Design Multiple Themes: Successfully implemented three distinct themes, providing users with customization options to enhance their experience. Responsive Interface: Created a fully responsive design that works seamlessly across various devices, ensuring accessibility and usability for all users.

  2. Technical Implementation Efficient Use of Next.js: Leveraged the full capabilities of Next.js, including SSR and SSG, to improve performance and SEO. TypeScript Integration: Utilized TypeScript to ensure type safety and reduce bugs, resulting in a more robust and maintainable codebase. Tailwind CSS Customization: Effectively customized Tailwind CSS to support multiple themes and maintain a consistent design across the application.

  3. Component-Based Architecture Reusable Components: Developed a modular component-based architecture, making the code more organized, reusable, and easy to maintain. State Management: Managed state efficiently using React hooks, ensuring smooth and responsive user interactions.

What I Would Do Differently Next Time?

  1. Enhanced Testing Automated Testing: Incorporate more automated testing, including unit tests and integration tests, to catch bugs early and ensure code reliability. End-to-End Testing: Implement end-to-end tests using tools like Cypress to simulate user interactions and verify the application's functionality.
  2. Advanced State Management Context API or State Management Library: Consider using the Context API or a state management library like Redux for more complex state management needs, especially if the application grows in complexity.
What challenges did you encounter, and how did you overcome them?

Theming Implementation: Challenge: Implementing multiple themes in a way that allows for easy switching and consistent styling was complex.

Solution: Used Tailwind CSS’s configuration capabilities to define custom themes. Leveraged React’s state management to dynamically apply different class names based on the selected theme. Persisted the theme selection in local storage to maintain the user’s preference across sessions.

What specific areas of your project would you like help with?
  1. CSS File Optimization: Challenge: The CSS files might contain redundant or poorly optimized code, leading to larger file sizes and potentially slower load times.

Help Needed:

  • Code Review: A detailed review of the CSS files to identify and eliminate redundancies and improve the overall structure.

  • Optimization Techniques: Guidance on implementing best practices for CSS optimization, such as minification, removing unused styles, and leveraging critical CSS for faster rendering.

  • Refactoring for Maintainability: Suggestions on refactoring the CSS to make it more maintainable and scalable, potentially incorporating BEM (Block Element Modifier) methodology or similar conventions.

  1. Improving and Enhancing Usable Themes Challenge: While the current themes are functional, they may lack polish and could be improved for better usability and aesthetics. Help Needed:
  • Design Feedback: Expert feedback on the current themes' design, color schemes, and overall aesthetic appeal. Suggestions for making the themes more visually engaging and user-friendly.

  • Accessibility Improvements: Recommendations for ensuring that all themes meet accessibility standards, including color contrast and readability for users with visual impairments.

  • Advanced Theming Techniques: Guidance on implementing more advanced theming techniques, such as CSS Variables for dynamic theming and better integration with Tailwind CSS.

CSS File Optimization

  • Audit and Clean-up: A thorough audit of the existing CSS to remove any unused or redundant styles.

  • Performance Enhancements: Techniques to improve CSS performance, including the use of critical CSS, lazy loading non-essential styles, and ensuring efficient use of

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 Ehsan'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
Frontend Mentor logo

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

Frontend Mentor

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

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

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit 1st-party linked stylesheets, and styles within <style> tags.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.