Re: It's time for contextual positioning

On Tue, Jun 10, 2014 at 11:36 PM, Rafał Pietrak <rafal@ztk-rp.eu> wrote:
> W dniu 10.06.2014 22:18, Tab Atkins Jr. pisze:
> [--------------------]
>>>>
>>>> position:contextual;
>>>> context:#elementID
>
> [-------------------]
>
>>> I strongly agree that something like this is necessary! However, I'd like
>>> to consider it as part of a general overhaul and sanification of absolute
>>> positioning, rather than jumping straight into a custom solution. ~TJ
>
>
> So if further consideration is due, I'd like to file a small comment here.
>
> 1. "in the spirit" of "cascading", the element referred to by "context:" in
> that example, should not require being an ID. I would think it should be
> just any selector CSS recognizes. possibly, a selector string just like
> jquery uses.
>
> 2. I would think, that being able to referre (by "context:" token) to other
> elements in order to "suck in" some styles from referred element should not
> be refrained to just position attributes.
>
> So I'd vote to device a generic syntax for such "referring to" cases. And
> gravitating towards (along my earlier expressed desire for $variables, with
> the above requirements in mind), I'm thinking of "syntax excape code" at the
> attribute value level.

Making a solution vastly more generic is not always a good thing.  In
particular, it makes this proposal much less likely to be implemented
(it has a ton of circular-dependency issues, which already informed
the design of CSS Variables.

It also makes it no longer solve your original use-case, since part of
the benefit of "tooltip-style" positioning is that it'll automatically
shift around to stay visible on the screen.  Using a generic mechanism
to import the position of another element and using it directly loses
this.

~TJ

Received on Thursday, 12 June 2014 20:44:12 UTC