Re: [css-text][css-conditional] language specific support for hyphenation and justification

> On 16 Jun 2015, at 15:40, Xidorn Quan <quanxunzhen@gmail.com> wrote:
> 
> It sounds like a valid use case, but I'm concerned about extending the grammar of @supports.

@supports is meant to be extended, that's why we included general enclosed. http://dev.w3.org/csswg/css-conditional/#general_enclosed

That said, my example was wrong, and to kick in general enclosed, we need extra parentheses "@supports (hyphenation-language())"

So I am not concerned about adding extra things there, but I am about adding things for trivial / too narrow uses.

> What about adding values to hyphens property which allow authors to specify the language the user agent should use for hyphenating, e.g. "p { hyphens: lang(fr); }" or "p { hyphens: lang-fr; }", and then require the user agent to consider a value invalid if the language specified is not supported.
> 
> In this way, we don't need to extend the grammar of @supports. In addition, we provide more detailed control to authors about the hyphenating, although other than being a condition, those values are almost useless.

Within @supports it would work, but as an actual property you'd be applying, it would be inconvenient. If you're working with a large but known set of languages, it would get ugly
  hyphens: lang-fr lang-en lang-de lang-es lang-it lang-no lang-se lang-dk lang-ru;

And if you're working with an open set of languages, it doesn't help.

So if we're supporting it only for the sake of conditionals, I'd rather make it work only in conditionals, and then the proposal isn't really different from "@supports (hyphenation-language())".


Instead of @supports, another approach could be to use a pseudo class
  p:supports-hyphenation {
    text-align: justify;
    hyphens: auto;
  }

This way you don't need to list languages manually, which seems an improvement.

 - Florian

Received on Tuesday, 16 June 2015 14:06:49 UTC