- From: Lee Kowalkowski <lee.kowalkowski@googlemail.com>
- Date: Thu, 20 Dec 2012 22:56:39 +0000
- To: "Thomas A. Fine" <fine@head.cfa.harvard.edu>
- Cc: public-html <public-html@w3.org>
- Message-ID: <CAGpS7GOrDibGXSKYO9xxLCX4_fvh1C26y_4rU5aT8bD6jhKGSg@mail.gmail.com>
On 20 December 2012 19:04, Thomas A. Fine <fine@head.cfa.harvard.edu> wrote: > I don't see how that's too bad: >> >> p {word-spacing:.5em} >> .sentence {word-spacing:.1em} >> >> (Although "sentence-spacing" would be more meaningful.) >> > > It doesn't do things in a logical order. And if you happen to throw in > any elements that are not .sentence inside of a paragraph results will not > be satisfactory. Which you can then fix of course. But this is really my > point. You shouldn't have to configure everything "wrong" at the highest > level, so that you can override the "wrong" setting as needed at all lower > levels. That's just poor design. > A separate property would be better, but that doesn't mean the outer level is wrong, just different, if it wasn't called word-spacing, but space-width, it wouldn't really be the wrong way around, would it? Sentences are at a higher level than words, I think, it doesn't look the wrong way around to my mental model of the structure, sentence spacing would be specified at the paragraph level, and word spacing at the sentence level. Having to (re)specify the low-level spacing to undo the effect of the high-level spacing isn't ideal though, that's true. Let me think about that. > And yes, "sentence-spacing" would be awesome to have. But for that you'd > need sentences, for which you'd need a sentence tag. Not necessarily, there isn't a letter element for letter-spacing or a word element for word-spacing. > If you had that, you could set word-spacing globally (or more likely leave > it alone), and set sentence-spacing globally, and you'd be done. (By the > way I just had a conversation on twitter with someone who called this > "crazy CSS". Of course he also told me I should just "obey the browser" so > maybe he's not the most credible source.) Ha ha, I'm sure crazier things have happened. Well, my example was a little old-school. In today's browsers, you could just: .sentence:after { content:' '; word-spacing:.5em; } Then you would be able to leave normal word spacing at the default setting. > I think the temptation may be to author this construct with no >> whitespace between sentences, like this: >> <p><sentence></sentence><**sentence></sentence><sentence>** >> </sentence><sentence></**sentence></p>. >> Then it doesn't work. >> >> As this technique would require the author to enter whitespace between >> sentence elements, I'm not sure it's the best approach, the new element >> would have to ensure the whitespace is implicit if it's not been >> explicitly entered. >> > > I don't see this as a problem at all. It's fully consistent with existing > behavior where you have to remember space between any other inline > elements, like anchors or spans. > Well, the last CSS technique doesn't require the author to enter the spaces, so unless the non-styled appearance is important, it doesn't matter. > I think the technique not mentioned yet is to preserve whitespace via CSS: >> >> p {white-space:pre-wrap;} >> >> For any typical developer/author, this would be easiest because they >> just need to enter additional space between sentences, if that's what >> they desire. >> > > This is perhaps the cheapest extra spacing choice, and one I hadn't > thought of to be honest. But of course you can't use CSS to finely control > sentence spacing, which is my goal. No, the spacing is still coarse with this approach, but I would say this is good enough for most users with an interest in extra space for sentences, as per the people that just can't kick the 'use two-spaces' habit people, like me. You can extend the spacing by using more spaces, that's about all the control you have with this. > There's another problem here, in that pre-wrap still honors newline > characters. Yes, but I wouldn't find that particularly burdensome. I'm not really in the habit of entering newline characters mid-sentence. > There's a glaring hole missing in white-space, in that there is no option > that preserves spaces, but does NOT treat new lines as line breaks. Which > would be the preferred choice for this in my opinion, if it were available. > Given the table at http://www.w3.org/TR/css3-text/#white-space, there seem to be 3 combinations that are not supported. Perhaps the columns in that table ought to be separate CSS properties. > And anyway didn't you just suggest that doing things with word-spacing > wasn't too hard? > It's the CSS that isn't hard. The hard part is using HTML to mark up sentences. I would find that extremely tedious (unless a markdown processor used 2-spaces as a delimiter). Telling HTML students they never need to use the sentence element would also feel a bit of a weird thing to have to do. Although I'm not sure if you're suggesting a sentence element any more. -- Lee www.webdeavour.co.uk
Received on Thursday, 20 December 2012 22:57:09 UTC