News for hackers. Stuff that matters.
Re:Show HN: Learn to use email with Git by OJFord on Thursday April 04, 2019 @02:32PM (#19575607)
No JS - I was baffled - did not know about `<label for="<target here>">`. Nice.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/la...

Re:Show HN: Learn to use email with Git by stronglikedan on Thursday April 04, 2019 @03:55PM (#19576444)
IMHO, the single-most underused HTML attribute. I get annoyed when I have to aim for the tiny box, instead of the nice long string of text next to it. Although, I can't count the number of times I was guilty of omitting it many moons ago.
Re:Show HN: Learn to use email with Git by forgotmypw on Friday April 05, 2019 @03:58AM (#19580625)
I'm not sure how "proper" this is, but you can also put the checkbox inside the label, turning the whole thing into one big clickable area.

<label style="padding:5pt"><input type=checkbox> this is label</label>

Re:Show HN: Learn to use email with Git by jancsika on Thursday April 04, 2019 @08:31PM (#19578513)
Isn't it better to nest the checkbox inside the label? Then you don't need the for attribute nor an id.
Re:Show HN: Learn to use email with Git by thristian on Thursday April 04, 2019 @09:17PM (#19578760)
That works nicely for checkboxes, but sometimes you want the form field and label to be in (say) different cells of a table row or something.
Re:Show HN: Learn to use email with Git by forgotmypw on Friday April 05, 2019 @04:02AM (#19580641)
You still have to do the complementary for= and id=, but I am also a proponent of nesting, though I have not solicited public opinion on it until just now.

Here is how I started doing it:

<label for=abc><input type=checkbox id=abc ...> display alphabet<label>

Re:Show HN: Learn to use email with Git by stephenr on Friday April 05, 2019 @10:44AM (#19583013)
What do you mean by “have to”? The whole point of nesting is that the association is implicit.
Re:Show HN: Learn to use email with Git by jalbertbowden on Thursday April 04, 2019 @10:37PM (#19579168)
labels should always be to the right of the checkbox/radio controls. never nest them. nesting is ok for other form controls in some instances, but you'll run into issues with various screen readers if you apply the for attribute while nesting. on that note, always nest when possible; the ux benefits make it crazy not to take advantage of it.
Re:Show HN: Learn to use email with Git by forgotmypw on Friday April 05, 2019 @04:00AM (#19580634)
Is there a reason to not nest the checkbox inside the label? I have always put them next to the checkbox until very recently, when I was trying to increase clickable area. I've found it ends up working much better than putting it beside, covering the area around the checkbox, too! Is this "improper HTML"?
Re:Show HN: Learn to use email with Git by rhn_mk1 on Thursday April 04, 2019 @04:12PM (#19576606)
It seems to have a cost though, how do I link to a specific page?

Anti-snark edit: what's the URL to a specific step?

Re:Show HN: Learn to use email with Git by Sir_Cmpwn on Thursday April 04, 2019 @05:37PM (#19577360)
Just merged this patch which makes each page linkable :)

https://lists.sr.ht/~sircmpwn/public-inbox/%3C20190404212127...

Re:Show HN: Learn to use email with Git by jalbertbowden on Thursday April 04, 2019 @10:35PM (#19579158)
Re:Show HN: Learn to use email with Git by Svip on Thursday April 04, 2019 @05:08PM (#19577137)
Could have used `:target` instead then.
Re:Show HN: Learn to use email with Git by darkstar999 on Thursday April 04, 2019 @04:47PM (#19576941)
You can't.
Re:Show HN: Learn to use email with Git by zepolen on Thursday April 04, 2019 @04:17PM (#19576645)
<a href>
Re:Show HN: Learn to use email with Git by darkstar999 on Thursday April 04, 2019 @04:47PM (#19576939)
Well, it takes some form & css trickery as well. I'd call this more hacky than anything. It doesn't let you link to a specific step.

https://git-send-email.io/index.css

Re:Show HN: Learn to use email with Git by gbear605 on Thursday April 04, 2019 @06:19PM (#19577673)
It does now, after a small patch: https://git-send-email.io/#step-2