This is a solution to the Tip Calculator App Challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- View the optimal layout for the app depending on their device's screen size.
- See hover states for all interactive elements on the page.
- Calculate the correct tip and total cost of the bill per person.
Mobile Design
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- LESS preprocessor
- Vanilla JavaScript
- Mobile-first workflow
- Bootstrap 5 for styling.
This project taught me how to effectively use the LESS preprocessor to create reusable and maintainable styles. Additionally, I enhanced my JavaScript skills by implementing dynamic calculations based on user input. For instance:
@strong-cyan: hsl(172, 67%, 45%);
@very-dark-cyan: hsl(183, 100%, 15%);
input {
border: 2px solid @very-dark-cyan;
&:hover {
border-color: @strong-cyan;
}
}I plan to focus on improving accessibility (e.g., better handling for screen readers) and optimizing performance for larger projects in the future.
- LESS Documentation - Helped me understand LESS syntax and usage.
- CSS-Tricks: Guide to LESS
To work with LESS in this project, you need to install the LESS preprocessor. Follow these steps:
-
Ensure you have Node.js installed on your system.
-
Open a terminal and run the following command to install LESS globally:
npm install -g less
-
Verify that LESS is installed by running:
lessc --version
-
Clone the project repository:
git clone https://github.com/Yashi-Singh-9/Tip-Calculator-App cd tip-calculator -
Compile the LESS file to CSS:
lessc style.less style.css
This command converts the
style.lessfile into a standardstyle.cssfile. -
Open the
index.htmlfile in your browser to view the project. -
Make any updates to the
style.lessfile as needed, and recompile it to see changes.
- LinkedIn - Yashi Singh
- Frontend Mentor - Yashi-Singh-9
Thanks to Frontend Mentor for the challenge, and to the developers who create amazing open-source tools like LESS!

