Design comparison
Solution retrospective
I had code a whole day for this, especially the icon in the input, do you have a better way to add the svg file to the input? Any feedback or suggestions about the naming classes (i very struggled to name them) would be highly appreciated. Is the JS logic okay? Or I can improve it? This is the first Junior project of mine, I have gg a lot. Thanks for your kindness
Community feedback
- @elaineleungPosted over 2 years ago
Hi To Dat, well done completing your first Junior project! I think you did a great job here, everything worked fine for me 🙂
If you want to hide the number spinners, you can try adding this in the CSS:
// For Chrome and Safari input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } // For Firefox [type="number"] { -moz-appearance: textfield; }
About the icons, what I did in my solution was to use a pseudo element with position absolute; since it's just an icon for decoration, I think it's fine to use a pseudo element here. There was another challenge where instead of absolute positioning inside an input, I used flexbox; I think it just depends on what you want to achieve in the end, because I think I added some animation for that challenge with the icon.
I noticed that you used a number array for the buttons, which I think works, even though the code is a bit clunky to read due to all the index numbering. In my solution I hardcoded the values into the inputs and then retrieved that value to work with; that's something you can try as well in the future. You can check out my solution here.
Keep going, you can do it! 😊
Marked as helpful2
Please log in to post a comment
Log in with GitHubJoin 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