{"action":"created","issue":{"url":"https://api.github.com/repos/w3c/csswg-drafts/issues/3118","repository_url":"https://api.github.com/repos/w3c/csswg-drafts","labels_url":"https://api.github.com/repos/w3c/csswg-drafts/issues/3118/labels{/name}","comments_url":"https://api.github.com/repos/w3c/csswg-drafts/issues/3118/comments","events_url":"https://api.github.com/repos/w3c/csswg-drafts/issues/3118/events","html_url":"https://github.com/w3c/csswg-drafts/issues/3118","id":360624310,"node_id":"MDU6SXNzdWUzNjA2MjQzMTA=","number":3118,"title":"[css-text-decor-4] Rethinking text-underline-offset","user":{"login":"litherum","id":918903,"node_id":"MDQ6VXNlcjkxODkwMw==","avatar_url":"https://avatars0.githubusercontent.com/u/918903?v=4","gravatar_id":"","url":"https://api.github.com/users/litherum","html_url":"https://github.com/litherum","followers_url":"https://api.github.com/users/litherum/followers","following_url":"https://api.github.com/users/litherum/following{/other_user}","gists_url":"https://api.github.com/users/litherum/gists{/gist_id}","starred_url":"https://api.github.com/users/litherum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/litherum/subscriptions","organizations_url":"https://api.github.com/users/litherum/orgs","repos_url":"https://api.github.com/users/litherum/repos","events_url":"https://api.github.com/users/litherum/events{/privacy}","received_events_url":"https://api.github.com/users/litherum/received_events","type":"User","site_admin":false},"labels":[{"id":381892077,"node_id":"MDU6TGFiZWwzODE4OTIwNzc=","url":"https://api.github.com/repos/w3c/csswg-drafts/labels/css-text-decor-4","name":"css-text-decor-4","color":"c5def5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-09-16T10:08:17Z","updated_at":"2018-09-16T20:32:47Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"There are a couple problems with the current formulation of `text-underline-offset`.\r\n\r\n- `text-underline-offset` is meant to be a delta added to wherever the underline happened to be placed, but the location where the underline is placed varies between different browsers and operating systems. The use case this is supposed to solve is \"my underline is just a little too high, let's nudge it down a little bit\" but because different browsers choose the locations differently, the current formulation doesn't satisfy this use case\r\n- What does it mean if both `text-underline-offset: from-font` and `text-underline-position: under` are applied to the same element? Such a formulation seems fairly meaningless.\r\n\r\nIn order to fix these problems, I propose the following changes:\r\n1. Add another value to `text-underline-position` named something like `standard`. Come up with some standard formula for the placement of the underline that all browsers can agree on, and state it in the spec. Importantly, don't make this the initial value - it's just an option that authors can specify if they want consistent underlines. I'm not particular on what specific formula is used, but I'll propose `font-size / 16` to get the conversation started. (This formula scales linearly with font size, and default-sized text gets a 1px underline gap, which is compatible with most (all?) browsers today)\r\n2. Move the `from-font` value from `text-underline-offset` to `text-underline-position`.\r\n3. Update the grammar of `text-underline-position` such that you can't specify more than one of [auto, standard, under, from-font].\r\n4. Now, `text-underline-offset` really can be just a delta, so there's no need for an `auto` value. Remove the `auto` value and have it just take a `<length>`.\r\n5. While we're at it, `text-underline-offset` should be able to take a percentage, which gets multiplied by the font size. This would be a good way to make the underline scale as the font size grows.\r\n"},"comment":{"url":"https://api.github.com/repos/w3c/csswg-drafts/issues/comments/421827968","html_url":"https://github.com/w3c/csswg-drafts/issues/3118#issuecomment-421827968","issue_url":"https://api.github.com/repos/w3c/csswg-drafts/issues/3118","id":421827968,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTgyNzk2OA==","user":{"login":"litherum","id":918903,"node_id":"MDQ6VXNlcjkxODkwMw==","avatar_url":"https://avatars0.githubusercontent.com/u/918903?v=4","gravatar_id":"","url":"https://api.github.com/users/litherum","html_url":"https://github.com/litherum","followers_url":"https://api.github.com/users/litherum/followers","following_url":"https://api.github.com/users/litherum/following{/other_user}","gists_url":"https://api.github.com/users/litherum/gists{/gist_id}","starred_url":"https://api.github.com/users/litherum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/litherum/subscriptions","organizations_url":"https://api.github.com/users/litherum/orgs","repos_url":"https://api.github.com/users/litherum/repos","events_url":"https://api.github.com/users/litherum/events{/privacy}","received_events_url":"https://api.github.com/users/litherum/received_events","type":"User","site_admin":false},"created_at":"2018-09-16T20:32:47Z","updated_at":"2018-09-16T20:32:47Z","author_association":"CONTRIBUTOR","body":"> `text-underline-offset` is defined to set “the offset of underlines from their initial position” where the “initial position” is defined in the [table below the propdef](https://drafts.csswg.org/css-text-decor-4/#underline-offset). It is not up to the UA, that is what the `auto` value means. Zero sets the underline at exactly that position.\r\n\r\nAh, I see. You're right, I didn't realize that this length refers to an offset *from the baseline* instead of an offset *from the browser's `auto` placement*. So `0` would be a terrible value that no one should ever use.\r\n\r\nIn that case, I guess my complaint is really about the name. Perhaps `text-underline-position` would be better, but that's already taken 😕\r\n\r\n> \r\n> > What does it mean if both text-underline-offset: from-font and text-underline-position: under are applied to the same element? Such a formulation seems fairly meaningless.\r\n> \r\n> Good question. `from-font` should maybe resolve to zero in this case. Or maybe calculate the distance from the alphabetic baseline to the font's preferred position, and then use that distance as the offset from the zero-offset `under` position.\r\n\r\nApplying the font's distance to under-underlines is never what you want. Picking 0 would be better than that.\r\n\r\nOn the other hand, if you move the value to `text-underline-position`, you can mechanically forbid this from happening, which seems better.\r\n\r\n> \r\n> > Add another value to text-underline-position named something like standard.\r\n> \r\n> I'm not convinced this is necessary if we address your other issues... but open to hearing your arguments. :)\r\n\r\nAs above, I was just confused about this part. I retract this part of the proposal.\r\n\r\n> \r\n> > Move the from-font value from text-underline-offset to text-underline-position.\r\n> \r\n> `text-underline-position` is more fundamental positioning--it can swap which side of the text the underline is on, etc.; `from-font` is really about just adjusting the offset, so I think it really does belong here.\r\n\r\nI don't quite understand the difference between \"fundamental positioning\" vs \"non-fundamental positioning\". They both are about positioning.\r\n\r\nPerhaps an even better solution would be to join the two properties into one, so you could say something like\r\n\r\n- `text-underline-position: under 2px` to mean \"2px beyond the under-underline\".\r\n- `text-underline-position: from-font 12.5%` to mean \"bump up the displacement from the font file by font-size / 8\"\r\n- `text-underline-position: baseline 6.25%` is the formula I mentioned above about \"standard\" placement\r\n- `text-underline-position: left baseline 6.25%` is the same thing, but specifies that underlines go on the left in vertical writing mode\r\n- `text-underline-position: under from-font` is a syntax error\r\n\r\n> \r\n> > While we're at it, text-underline-offset should be able to take a percentage, which gets multiplied by the font size.\r\n> \r\n> This is a severe oversight and we should definitely fix it. We should maybe try to be consistent about this across this property, `letter-spacing` and `word-spacing` (#2165), and ideally, `line-height`... Maybe in a separate issue, though?\r\n\r\nhttps://github.com/w3c/csswg-drafts/issues/3121\r\n"}}
{"actor":{"display_login":"litherum"}}