Re: [csswg-drafts] [css-anchor-position-1] Can we clarify the `inset-area` syntax? It can be confusing to read and reason about. (#9862)

The CSS Working Group just discussed ``[css-anchor-position-1] Can we clarify the `inset-area` syntax? It can be confusing to read and reason about.``.

<details><summary>The full IRC log of that discussion</summary>
&lt;bramus> TabAtkins: (shows spec with grammar)<br>
&lt;bramus> TabAtkins: some time ago una and miriam found that the inset-area property is confusing to read and write<br>
&lt;bramus> TabAtkins: they came together and wrote up a few suggestions<br>
&lt;bramus> TabAtkins: fantatasai and i looked into and think they are quite right<br>
&lt;bramus> fantasai: we came up with some options<br>
&lt;bramus> TabAtkins: first one is inset-area-alpha which is what is in the spec<br>
&lt;bramus> nsull: do you have an example?<br>
&lt;bramus> TabAtkins: see the thread: examples by una<br>
&lt;bramus> TabAtkins: were also covered in the slides<br>
&lt;bramus> TabAtkins: under i-a-a you would write bottom, center-bottom or bottom center<br>
&lt;bramus> TabAtkins: they are all equivalent<br>
&lt;bramus> astearns: clarify?<br>
&lt;bramus> TabAtkins: one keyword is the row, the other the column<br>
&lt;bramus> fantasai: orig concept had a slash to divide both<br>
&lt;bramus> fantasai: you had 9 grid, and keyword would say which are you want to cover. very  simple if you want 1 part of the grid: keywords and slash in between<br>
&lt;bramus> nsull: so top left?<br>
&lt;bramus> fantasai: top / left<br>
&lt;bramus> fantasai: but with multiple slots there would 2 keywords on one part of the slash<br>
&lt;astearns> old spec: left center / top<br>
&lt;bramus> TabAtkins: example in old spec: `left center / top`<br>
&lt;bramus> TabAtkins: what spec curr says is that would be `center-left top`<br>
&lt;bramus> TabAtkins: or flip the order, doesnt matter<br>
&lt;bramus> fantasai: dont care about slash vs space vs hyphnes<br>
&lt;jensimmons> q+<br>
&lt;bramus> fantasai: issue was about not liking the slash and needing to combine keywords<br>
&lt;bramus> fantasai: so thats why we need the hyphen now<br>
&lt;bramus> fantasai: or we need to introduce some bracketting syntax: span() or [] or …<br>
&lt;bramus> … to make clear that you have 2 units: 1 for each axis<br>
&lt;bramus> TabAtkins: with span, you could do span(left center)<br>
&lt;astearns> ack jensimmons<br>
&lt;bramus> jensimmons: getting rid of the slash seems confusing<br>
&lt;bramus> … and center is valid for both axis<br>
&lt;bramus> … you dont really know which direction<br>
&lt;vmpstr> q+<br>
&lt;bramus> … hyphenating them can group them indeed, but there’s nothing else in css that does that<br>
&lt;astearns> I am liking the named functions to show what the keywords are for<br>
&lt;bramus> … slash came from grid: grid-col: 3 /4<br>
&lt;bramus> … the slash delineates stuff<br>
&lt;kbabbitt> q+<br>
&lt;bramus> … dont know why the slash wasnt liked<br>
&lt;bramus> … still kind like it<br>
&lt;bramus> +1<br>
&lt;bramus> miriam: didnt raise issues about the slash<br>
&lt;bramus> … proposals happened to remove the slash<br>
&lt;bramus> … rest fo syntax was concfusing<br>
&lt;nicole> q+<br>
&lt;bramus> TabAtkins: once you remove, you dont need another separator<br>
&lt;bramus> … only use slash sparringly in css<br>
&lt;bramus> miriam: i found 'center left' confusing<br>
&lt;bramus> … is it a span(center left) or center row and left column<br>
&lt;bramus> TabAtkins: (clarifies on example)<br>
&lt;bramus> miriam: the slash only gives you htat if you are explicit about everything<br>
&lt;bramus> … (missed)<br>
&lt;bramus> … you have to know if there is an implied slash<br>
&lt;bramus> … vs one value of center+left<br>
&lt;bramus> TabAtkins: when doing center left one would be col and row<br>
&lt;astearns> ack vmpstr<br>
&lt;bramus> vmpstr: confused by 'center-bottom' and 'bottom center'<br>
&lt;bramus> … could this be a shorthand with al longhand like inset-row and inset-column?<br>
&lt;bramus> … with area its not really clear which is which (row or col)<br>
&lt;bramus> TabAtkins: curr spec now resembels bg-pos<br>
&lt;bramus> … unless you need to fill 2 rows or cols you need the dashed keywords<br>
&lt;bramus> … with nly 1 you get the current keywords<br>
&lt;bramus> … can also not use the inset-earea and use trbl props<br>
&lt;florian> q+<br>
&lt;bramus> fantasai: if you need only 2 tracks then you need new keywords. not a problem for 1 or 3 (all)<br>
&lt;bramus> … had resolved on syntax for bg-pos 4 which includes all logical keywords<br>
&lt;miriam> q+<br>
&lt;bramus> … both like block-start inline-start type but also x-start and y-start<br>
&lt;bramus> … that you can indicate the axies<br>
&lt;bramus> … for convenience you can do start start or end end<br>
&lt;bramus> … that syntax is in one of the issues<br>
&lt;fantasai> -> https://github.com/w3c/csswg-drafts/issues/549#issuecomment-1823607623<br>
&lt;astearns> ack kbabbitt<br>
&lt;una> q+<br>
&lt;bramus> kbabbitt: am I missing sth but wiotu slash `center-start all` is that left chunks or top ones?<br>
&lt;bramus> TabAtkins: neither tell you what axis you are on<br>
&lt;bramus> … we fall back to standard block and then inline order<br>
&lt;bramus> … so center-start is block<br>
&lt;bramus> … and all is inline<br>
&lt;bramus> … rest of css also follows this order<br>
&lt;bramus> … so you have top 6 cells<br>
&lt;bramus> kbabbitt: so you fallb ack to implicit ordering<br>
&lt;bramus> TabAtkins: only if we can’t really know<br>
&lt;bramus> fantasai: (backs that up)<br>
&lt;bramus> TabAtkins: with dash keywords the order is clear<br>
&lt;fantasai> fantasai: but you could write center-inline-start all, which would make it more obvious<br>
&lt;bramus> kbabbitt: maybe we can come up with some ascii art solution?<br>
&lt;bramus> TabAtkins: intersting for large regions. only have 3x3 here, so might be ok<br>
&lt;astearns> ddack nicole<br>
&lt;astearns> ack nicole<br>
&lt;bramus> nsull: is center  a good keyword? maybe middle for top to bottom? to elimiate one of the cetners?<br>
&lt;bramus> TabAtkins: there is precedent for center to be for both axies<br>
&lt;bramus> nsull: syntax looks very confusing, hard on authors. both dashes and slashes I found confusing but dashes might be a bit more clear.<br>
&lt;bramus> TabAtkins: vast majority of cases is 1 row 1 col, and there its not that steep of a learning curve. 1 keyword and the obvious one for each axis<br>
&lt;masonf> One idea for the "two things" keywords: what about adding -and-. So 'center-and-start' or 'center-and-right'.<br>
&lt;bramus> fantasai: I think `bottom center-rigth` is a fairly common one<br>
&lt;bramus> nsull: and `… center-left`<br>
&lt;bramus> fantasai: e.g,. a dropdown that needs to grow out to the side<br>
&lt;bramus> … two col is reasonable common I think<br>
&lt;jensimmons> q+<br>
&lt;jensimmons> q-<br>
&lt;bramus> … we can introduce longer logical keywords<br>
&lt;bramus> … dont love the hyphenated syntax<br>
&lt;bramus> … if we get rid of the slash then we need to do something else<br>
&lt;bramus> … open to other ideas<br>
&lt;bramus> … need consistency with bg position<br>
&lt;bramus> … use same set of keywords<br>
&lt;bramus> qq+<br>
&lt;bramus> nsull: would there be a way to name the most common cases?<br>
&lt;bramus> TabAtkins: specialized keywords are compatible with the current spec<br>
&lt;bramus> astearns: and the combos for authors could be stuffed into a variable<br>
&lt;bramus> nsull: would be interesting to figure out the most common ones so that its easy on authors<br>
&lt;fantasai> scribe+<br>
&lt;astearns> ack bramus<br>
&lt;Zakim> bramus, you wanted to react to nicole<br>
&lt;fantasai> bramus: if inset-area was a shorthand, and the order was fixed, then it would be clearer<br>
&lt;astearns> ack florian<br>
&lt;fantasai> fantasai: which one is the row and which is the column if you use physical keywords and change writing modes?<br>
&lt;bramus> florian: so / has problem what miriam talked about but ohter syntaxes dont<br>
&lt;bramus> … one you called alpha and another one you didnt mention<br>
&lt;bramus> … you seem to have a preference<br>
&lt;astearns> +1 to function names :)<br>
&lt;bramus> … what are downsides ofthat other one><br>
&lt;bramus> TabAtkins: its more tying: span(…)<br>
&lt;bramus> florian: like this one better<br>
&lt;bramus> TabAtkins: aesthetic decision<br>
&lt;bramus> fantasai: no strong opinion on either<br>
&lt;bramus> astearns: i like the span() too<br>
&lt;bramus> florian: less typing indeedt hef irst, but unclear about the hyphen when explaining/minuting<br>
&lt;emeyer> +1 to Nicole’s point about teaching!<br>
&lt;masonf> q?<br>
&lt;masonf> q+<br>
&lt;astearns> ack miriam<br>
&lt;bramus> TabAtkins: grammaticlaly there are similarly complex (missed)<br>
&lt;bramus> miriam: can get best of both worlds. confusing part is center: what if we said `bottom span-right`<br>
&lt;bramus> … if we take center out of the equaition<br>
&lt;bramus> florian: so `span-rigth` is the same as `center-rgith`<br>
&lt;bramus> miriam: part of confusion is center meaning two things<br>
&lt;chrishtr> xlo,<br>
&lt;bramus> … simpler keywords could fix that<br>
&lt;vmpstr> +1<br>
&lt;bramus> nsull: `span 2`<br>
&lt;bramus> TabAtkins: (missed)<br>
&lt;bramus> miriam: you could say anchor right?<br>
&lt;astearns> s/(missed)/maybe we could use cover?/<br>
&lt;bramus> florian: what about 2 rows and 2 cols?<br>
&lt;astearns> ack una<br>
&lt;bramus> chrishtr: maybe take it back to issue?<br>
&lt;astearns> zakim, close queue<br>
&lt;Zakim> ok, astearns, the speaker queue is closed<br>
&lt;masonf> q-<br>
&lt;bramus> una: important to get right indeed. all want to simplify. first spec was maybe a bit too looose. like changes in v2 as they are more consistent. spaces and slashes were confusing to me, especially with keywords that could be flipped. like idea of `span()` but could be confusing with `span 2` from grid for example<br>
&lt;bramus> … need to see how it interacts with rest of css. `span()` would be clear … a function would do that<br>
&lt;fantasai> bramus: it's confusing to have a function and keyword with the same name<br>
&lt;bramus> astearns: so lets take back to issue<br>
&lt;bramus> TabAtkins: could be get resolution on something?<br>
&lt;bramus> astearns: seems like people didnt mind the slash<br>
&lt;bramus> florian: but the syntax that include the slash had problems<br>
&lt;emeyer> I do not mind the slash, but also do not mind a functional syntax.<br>
&lt;bramus> TabAtkins: I get why center right can be confusing … any other keyword than center could fix indeed<br>
&lt;bramus> fantasai: yes<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9862#issuecomment-1942129089 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 13 February 2024 18:12:30 UTC