-
Notifications
You must be signed in to change notification settings - Fork 698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-anchor-position] position-anchor
should be defined as a longhand of position
#10321
Comments
Yep, that makes sense. We would be happy to adopt that as a resolution and ship the corresponding change in Chrome. Perhaps we can just call for an async resolution? Or we can try to get one at Wednesday’s meeting. |
@fantasai I think you meant |
position-anchor
should be defined as a shorthand of position
position-anchor
should be defined as a longhand of position
The CSS Working Group just discussed
The full IRC log of that discussion<flackr> fantasai: in earlier issue we renamed anchor-default to position-anchor, motivation was to allow position to be shorthand of this and poss other stuff later. We didn't resolve on short-handing relationship. Designing a syntax that accomodates everything can be deferred but we need to decide whether position reset it now<florian> +1 <kizu> +1 <masonf> +1 <emilio> g+ <flackr> TabAtkins: sounds good, we don't have a strong opinion either way <emilio> q+ <flackr> astearns: do we need a resolution for both the shorthand and that it reset? <flackr> fantasai: yes <flackr> emilio: It feels weird that if you had an anchored thing that is abs pos, and you want to make it fixed pos you now need to fight with the reset on position-anchor. Authors may find that confusing <flackr> fantasai: the current values of static | absolute | fixed | etc should probably be their own longhand as well so you don't have to have that fight <iank_> Modulo any compat constraints, shorthanding properties which have existing since the beginning of time a higher risk than others. <flackr> fantasai: i.e. we'll have a longhand for those position values <flackr> emilio: I think people will do position: fixed or position: absolute anyways without thinking that it reset but this is fine as a proper solution <flackr> fantasai: our proposal for the longhand is position-type <flackr> TabAtkins: it would be nice to have the additional longhands, i don't htink this blocks anything. It's slightly awkward but I think okay that you need to reset the anchor <flackr> emilio: but you need to define the longhands? <flackr> TabAtkins: not necessarily. Since it's reset only the other longhands don't need to exist <flackr> fantasai: They do need to exist <flackr> TabAtkins: right, internal property <flackr> emilio: I don't think this works even if it is an internal property because shorthands aren't typically included in enumerations <flackr> astearns: there might be a web compat risk? <flackr> emilio: def <flackr> TabAtkins: is that a general issue we would have with any properties becoming shorthands? <flackr> emilio: we have the issue when it becomes a shorthand it stops getting enumerated and the longhands become enumerated. We don't have the issue that the longhand is hidden so you can't access the property <flackr> s/can't access/ isn't enumerated <flackr> TabAtkins: then i propose position-type <flackr> fantasai: or position-style like text-wrap-style or list-style <kizu> +1 to `position-type` <flackr> florian: i like type better <flackr> astearns: me too <flackr> astearns: at this point, can we resolve on making position a shorthand of position-anchor and position-type? <flackr> astearns: and then worry about the enumeration issues later <flackr> emilio: I think this is fine. The big risk is someone enumerating styles and copying them over. If we have both longhands then it's not as much of a worry <flackr> iank_: it's more of a risk for people manipulating styles directly. When the enumeration disappears they may be relying on position always being in the enumeration <flackr> iank_: we've seen this before, most recently white-space, where people assume the property will read back the same as the property they set <flackr> astearns: is this something where you would like to wait on the decision until we have a compat assessment? Would you object to a resolution? <emilio> ack emilio <flackr> iank_: taking a resolution is fine, but we might get regressions and have to revert and take another resolution <astearns> ack fantasai <flackr> iank_: shorthanding properties that have been around since time immemmorial carries risk <flackr> fantasai: can we update the way we handle this to include shorthands in enumeration for these cases to avoid the problem? <flackr> iank_: i think this may break things even more <flackr> astearns: this might be worth opening another issues to discover whether the pitfalls are better or worse <flackr> emilio: if you do this you get redundant properties. We could special case some legacy ones, but this is iffy. The order is lexicographical if you have cases where a shorthand shows up between longhands <flackr> astearns: Okay, let's have a separate issue for enumerating shorthands, for this issue the proposed resolution is we make position a shorthand of position-anchor and a new position-type. The shorthand resets both <flackr> fantasai: and we should add a shorthand syntax that's not resetting <flackr> florian: but that's not urgent <flackr> RESOLVED: Make position a shorthand of position-anchor and a new position-type property. The shorthand resets both. |
|
Reopening this issue, as after doing some implementation exploration we think this is harder than originally assumed. We've also come to somewhat disagree with the original motivation entirely. First, see #8398 (comment) for the details of what we need to do to safely shorthandify a legacy property. It's definitely not generally safe to do so, and we'll have to do something special for a property that's been a longhand as long as (I think we want to shorthandify Second, the main motivation for making List of `foo` vs `foo-*` properties that are *not* shorthand/longhand pairs:
(Obtained by visually scanning https://drafts.csswg.org/indexes/#properties.) (Notably, there are several other Usability-wise, tho, I think we actually don't want these to be set together. If you switch from Like, there's four cases that you can fall in when switching from
So 1 and 2 don't care, 3 is slightly better if they're unrelated, and 4 is slightly better if they're related. Between 3 and 4, I think 3 is more likely to come up, if such scenarios happen at all. If you just aren't using a default anchor (for 4), you can generally just not mention it and it'll act like the same as not having one at all. (Contrast this with So, we'd like to revert this resolution, and instead resolve that |
Let me walk through your examples with the
Shorthanding lets you reset everything or flip only the positioning type, whichever is appropriate to your use case.
Let's dig into that issue. It's been looming over these discussions long enough. |
Let's set aside the "can we even shorthandify Looking at the wider design space, what things we'll want to put into And stickypos wants to be able to use Beyond this smaller issue, the larger suite of anchor-pos-related properties that could potentially be folded into If we were designing If the shorthanding compat issues are resolvable such that we could shorthandify I could even see us introducing a new shorthand, designed just for abspos/fixpos, which sets |
Hi, this issue has received significant discussion within the Chrome team. Our conclusion: Given all the compat risk, implementation difficulty and potential for developer confusion, Google doesn't think shorthand-ifying |
WebKit would like to take some time to understand and potentially address Chrome's concerns. To that end, we're fine with leaving the spec as-is for now ( |
The CSS Working Group just discussed
The full IRC log of that discussion<andreubotella> TabAtkins: A while back, we resolved to make position a shorthand for position-type (setting the absolute, fixed... keywords) and position-anchor<andreubotella> We've experimented since then, and the Chrome team would like to reverse this resolution <andreubotella> Compat reason: we'd thought there would be a stronger compat reason to not shorthand position or other properties, but upon further review, while there's still risk, it's not that bad <andreubotella> so we should consider shorthanding these older property <andreubotella> we don't want to do it without a good reason because it's risky though <TabAtkins> https://github.com//issues/10321#issuecomment-2136102979 <andreubotella> Also, after some thought, we don't agree with shorthand position being part of the position shorthand <andreubotella> while we have a pretty strong tradition of prefix name shorthands being shorthands for properties with the same prefix, but it's not as strong as thought <andreubotella> there's a list in that thread <andreubotella> THe argument from langauge design is weaker than we thought, and that strengthens the argument for not making it <andreubotella> to make a reasonable shorthand out of this, you need more complex grammar, which makes it harder to use <astearns> q+ <andreubotella> this is in the category of properties that are adjacent to other properties but shouldn't be reset together <astearns> ack fantasai <andreubotella> shouldn't reset, especially if you're switching from static to fixed <andreubotella> so we object to making position a shorthand right now, and in particular with making position anchor a part of that shorthand <andreubotella> astearns: is the complexity of the shorthand across all the value spaces, or does it only get complex when trying to set anchor positioning values? <andreubotella> TabAtkins: both. The first, because anchor positioning only appliies to static or fixed, ... <andreubotella> fantasai: That's not true, if you set to sticky it would ignore all of the anchor positioning stuff <andreubotella> TabAtkins: I think none is one of the few obvious counterexamples, but more complex distinctions we don't do too often <astearns> ack astearns <andreubotella> the second bit of complexity: ... and ... are custom idents, so we'd need to make them distinguishable <TabAtkins> like, `position: absolute --foo / --bar` <andreubotella> explicitly setting position: absolute, maybe with container in there, and then ... gives a more readable CSS in our opinion <andreubotella> fantasai: We are interested in trying to adress Chrome's concerns. We're happy with the spec as it is now until those concerns are solved, but not happy with reverting before <andreubotella> florian: I agree with TabAtkins about the language not being consistent with the prefix not always being the shorthand. About position resetting all of the longhands, how important is it? <andreubotella> fantasai: it depends on whether we want a shorthand that sets it together <andreubotella> we'd have to design that and put it out to the whole working group <andreubotella> florian: Even if the shorthand doesn't set it together, for the things that are set by position, would you have interference from the other things set by it? <andreubotella> If we're reverting and leaving the issue open for now, I'm good with it <andreubotella> TabAtkins: ... and inset-area being set together ... <andreubotella> fantasai: That's a problem with the UA stylesheet <TabAtkins> s/inset-area/insets and position-area/ <andreubotella> RESOLVED: undo the previous resolution and not add position-anchor and position-type to the position shorthand for now <florian> s/from the other things set by it/from the other things set by it if they don't get reset <fantasai> scribenick: fantasai |
To me, the main question here is whether, when changing from one (Having syntax to set them is nice too, but if that's the challenge, I feel that can be dealt with later, including possibly never if that challenge turns out to be too hard to solve) |
Not particularly, no. It seems fairly unlikely, imo, that you'll switch from (I said in the call that changing |
In #10004 we proposed to rename
anchor-default
toposition-anchor
and to allowposition
to shorthand both arguments.The resolution was taken to rename the property, but because people were unsure about how to define a combined syntax with
position-container
, a combined shorthand syntax for the two was deferred.However the question of whether
position
resetsposition-anchor
was not resolved, not edited in, and not put on the agenda for follow-up as agreed by the CSSWG.If we are to create a shorthand syntax in the future, we need the resetting relationships to be resolved and implemented now, i.e.
position
needs to resetposition-anchor
even if it can't set it to anything but the initial value.The text was updated successfully, but these errors were encountered: