Re: Cross Referencing Between Elements

On Sat, Jun 14, 2014 at 8:40 AM, Bobby Mozumder <mozumder@futureclaw.com> wrote:
> Not sure how I’d reference the state of another element with this right-hand
> spec proposal.  I’ve had several times where i needed at least simple cross
> references to just things like :hover.
>
> For example, change the color of an element based on if some other element
> in the DOM tree has :hover on it, or :active.  I don’t see how a selector on
> the right-hand side can select that state. (maybe store the state in the
> source element as a variable?)
>
> CSS does need a stateful representational model that perhaps includes
> time-domain considerations and variable storage… this could get rid of a lot
> of Javascript usage.

The issue here is that these kinds of things make it *far* more
complicated to resolve CSS efficiently, and we can still only give you
abilities for a small handful of use-cases, because declarative models
are hard to extend.  JS is still the right thing to use for lots of
these dynamic use-cases, and will probably always be.

~TJ

Received on Saturday, 14 June 2014 19:54:41 UTC