Re: [csswg-drafts] [css-text] Allow letter-spacing to have unitless values like line-height

@fantasai, I believe that calculating percentage from the width of the normal inter-word space is useful (one quite common use case would be removing spaces completely with `word-spacing: -100%`, some designs could require doubling the spaces with `100%` value, etc.). I'd say that `letter-spacing` values relative to the inter-word space width (e.g. spacing the letters for a half of it) also would have its use cases (Photoshop is not the only design tool, after all, designing directly in browser is also quite popular), so if font-related percentages would be redefined, it would be worth reintroduce this measure as a new unit (maybe `ws`?) suitable for both properties, as well as for margins/paddings etc.

And what about reusing the `fr` unit for font-related properties? It's already a "length-but-not-exactly", it means "fraction", so it could inherit as a _fraction_ of the font-size instead of the computed length... Is it a too crazy idea?

@Nadya678, the `word-spacing` property is defined as an "_extra_ spacing _in addition_ to the intrinsic inter-word spacing". The currently proposed (yet not supported by browsers) standard CSS way to shrink inter-word spaces to zero is `word-spacing: -100%`. The most common practical CSS solutions are either setting `font-size: 0` to the container and resetting it for the items, or setting the `word-spacing` to some negative value like `-0.31em` (the exact value depends on the white-space character width, usually between 0.25 and 0.4em). For monospace fonts, `word-spacing: -1ch` should work. Another option is to use a custom font where the whitespace character has zero width ([like this](https://github.com/patrickkunka/zero-width)). However, the best way to avoid unwanted spaces between design blocks is not using inline-blocks for them at all and using Flexbox instead.

-- 
GitHub Notification of comment by SelenIT
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2165#issuecomment-355907826 using your GitHub account

Received on Monday, 8 January 2018 08:36:20 UTC