This is a solution to the Body Mass Index Calculator challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- Select whether they want to use metric or imperial units
- Enter their height and weight
- See their BMI result, with their weight classification and healthy weight range
- View the optimal layout for the interface depending on their device's screen size
- See hover and focus states for all interactive elements on the page
- Solution URL: https://github.com/srijanss/bmi-calculator
- Live Site URL: https://srijanss.github.io/bmi-calculator/
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Grid
- Mobile-first workflow
- Vite - Lightweight frontend tooling
- PostCSS - Tool to transform CSS using plugins
- I learned about the css to hide the spin button of input type number in different browsers
& input[type="number"] {
appearance: none;
-webkit-appearance: none;
-moz-appearance: textfield;
&::-webkit-inner-spin-button,
&::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
}
-- I also learned how to apply different border radius to the div element. This was the result of many hit and trials
& #bmi-calculator-info {
--circle-radius: 150px;
border-radius: 16px var(--circle-radius) var(--circle-radius) 16px;
}
- I also learned about how to apply multiple linear gradients to create the background effect like the design
@define-mixin bmi-app-gradient {
background-image: linear-gradient(
to left top,
#d6e6fe 0%,
#d6fcfe50 50%,
#d6fcfe00 100%
);
}
#curved-background {
width: 100%;
height: 640px;
position: absolute;
top: 0;
left: 0;
@mixin bmi-app-gradient;
border-radius: 0 0 35px 35px;
background-color: var(--color-white);
z-index: -1;
}
- Website - Srijan Manandhar
- Frontend Mentor - @srijanss