W3C home > Mailing lists > Public > www-style@w3.org > May 2018

RE: [PROPOSAL] :event:then(:event, ...) selector

From: Andrew Fedoniouk <andrew.fedoniouk@gmail.com>
Date: Thu, 31 May 2018 16:09:52 -0700
Message-ID: <5b1080c0.1c69fb81.32560.f7f9@mx.google.com>
To: Tab Atkins Jr. <jackalmage@gmail.com>, Michaël Rouges <michael.rouges@gmail.com>
Cc: www-style list <www-style@w3.org>

Idea  (as far as I understand it) is to have some mechanism that will allow to distinguish cases when element is getting particular state and when it looses it.

Use case: 

1. I'd like to define "mousein" animation different from "mouseout". 
2 Yet to have "focus" animation different from "blur" animation. 

Current state of CSS affairs does not allow to define №1 and №2 at the same time.

Andrew Fedoniouk

Terra Informatica Software, Inc.

From: Tab Atkins Jr.
Sent: May 31, 2018 3:24 PM
To: Michaël Rouges
Cc: www-style list
Subject: Re: [PROPOSAL] :event:then(:event, ...) selector

I copied this over to the GH repo as issue #2725
<https://github.com/w3c/csswg-drafts/issues/2725>.

On Mon, May 28, 2018 at 11:35 AM, Michaël Rouges
<michael.rouges@gmail.com> wrote:
> Hi all,
>
> Tiny proposal about a then selector, useful to mais some transitions, etc.,
> when events are chained.
>
> Example :
>
> ```
> /* triggers when the focused ol loose the focus, if the ol is still hovered
> */
> ol:focus:then(:hover) {
>   transition: width .3ms;
> }
> ```
>
> Useful, for example, to close a focused list, but after a possible click
> effect, or to show a message, when an input pass from :invalid to :valid,
> etc.
>
> What do you think about it?
>
> Michaël Rouges - https://github.com/Lcfvs - @Lcfvs
Received on Thursday, 31 May 2018 23:10:17 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:09:10 UTC