@pikapikamart
Posted
Hey, awesome work on this one. Layout in desktop is small, did you code this while you are zoomed in though? Making it larger would be really great. Currently it is not responsive enough since if you go at around 640px going down, content are being hidden. Mobile layout though looks good.
Some suggestions would be:
- You don't need the
h1
in theheader
since there is the website-logo that will give the name. For theh1
, you should have used that inside themain
as the first text-content element. Using like a text-content of "frontendmentor tip calculator example". - Website-logo
img
should be using the website's name as thealt
likealt="splitter"
. Remember that a website's logo is meaningful so always make sure it uses the properalt
value. - Those
bill
andnumber of people
should be alabel
for theinput
below them and not a heading tag. - The dollar-icon as well the person-icon on each input should have
aria-hidden="true"
to be hidden totally for screen-reader users. - For the all the
input
used in here, you should have usedtype="number"
so that you won't have to error-checking for a value that is not a number. Use amin
and attribute as well so that there will be a minimum value to be chosen upon. - Also if you are making the
input
look like it has an error, add aaria-invalid="true"
on it so that it will be clear and you could use that as a styling hook likeinput[aria-invalid="true"]{}
- For the
button
section, maybe making each:focus-visible
state more visible since right now it is hard to tell whatbutton
am I in. - Since you used
button
in here, you could nest them inside aul
since those are "list" ofbutton
and it will give extra information to the user on how manybutton
are there. Thebutton
you would need to have anaria-live
element that will announce the certainbutton
has been pressed or selected, becausebutton
alone is not informative. I haven't tackled this challenge yet so I can't provide a sample hehe. - The custom-input needs to have an associated
label
tag on it. Since there are visible-label, thelabel
would be a screen-reader only label, meaning it would make user of likesr-only
class. The text-content should describe what theinput
needs like the value on theplaceholder
or likeadd custom value
. - Number of people
input
has nolabel
, use the same method above as well. - Again when wrapping a text-content do not just use
span
to wrap it, use meaningful element like ap
tag if it just a regular text or heading tag if it is an heading. - Another idea as well is to make use of
aria-live
as well dictating that the calculator has reset when the reset-button is toggled, just to make it more accessible. - Lastly, addressing the responsiveness since content are being hidden on that screen-width that I said above.
Aside from those, again great job on this one.
@mikeyxx
Posted
@pikamart As usual, thank you so much. I like how much you go into the details. I actually just felt the desktop layout was big enough for a calculator but looking at it again, I see your point. I will make all the edits you suggested.
Thank you:)
@mikeyxx
Posted
@pikamart Is it compulsory to use both alt="" and aria-hidden="true" for an image? Can't I just use only alt=""? and in place of <span>, can I use <small> instead of <p>?
@pikapikamart
Posted
@mikeyxx RIght now yes, because if you only use alt=""
for a decorative image, VoiceOver in apple will still read the image, that is why adding aria-hidden="true"
will completely hide the element for screen-reader.
When wrapping a text, always use p
tag or other meaningful element. You can use span
or small
but inside the meaningful element.
<p>I am a p tag</p>
<p> I have a
<small> small </small>
tag
<p>
@mikeyxx
Posted
@pikamart I've made all the changes you suggested. Debugging is hell!! but I learnt a ton. Thank you. Next I will be working on the time tracking dashboard challenge hub.