- From: Thomas A. Fine <fine@head.cfa.harvard.edu>
- Date: Thu, 20 Dec 2012 14:04:37 -0500
- To: Lee Kowalkowski <lee.kowalkowski@googlemail.com>
- CC: public-html <public-html@w3.org>
On 12/19/12 8:30 AM, Lee Kowalkowski wrote:
> On 17 December 2012 18:55, Thomas A. Fine <fine@head.cfa.harvard.edu
> <mailto:fine@head.cfa.harvard.edu>> wrote:
>
> But it doesn't work because:
> * Using spans with CSS and the word-spacing parameter [...]
>
> 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.
And yes, "sentence-spacing" would be awesome to have. But for that
you'd need sentences, for which you'd need a sentence tag. 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.)
> 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.
> 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. There's another problem
here, in that pre-wrap still honors newline characters. 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.
And anyway didn't you just suggest that doing things with word-spacing
wasn't too hard?
tom
Received on Thursday, 20 December 2012 19:05:06 UTC