Re: [csswg-drafts] [css-view-transitions] 'type' argument that takes an array of types is very weird naming (#10070)

> > That one is a list of idents though. It's equivalent to class, it's not a JS array. So I think type is fine for the descriptor.
> 
> The `class` vs `classList` is a good counter for why `type` in CSS is reasonable. But it feels like authors will have an easier time if its the same name everywhere:
> 
> 1. [at-rule](https://drafts.csswg.org/css-view-transitions-2/#view-transition-type-descriptor)
> 2. [CSSViewTransitionRule](https://drafts.csswg.org/css-view-transitions-2/#navgation-behavior-rule-interface)
> 3. [startViewTransition](https://drafts.csswg.org/css-view-transitions-2/#dictdef-startviewtransitionoptions)
> 4. ViewTransition object
> 
> 2. and 4) are already using `typeList`. So could startViewTransition and the at-rule use `typeList` as well. We have to do `typeList` for CSSViewTransitionRule because of [[css-view-transitions-2] `CSSViewTransitionRule.type` overrides deprecated `CSSRule.type` #9905](https://github.com/w3c/csswg-drafts/issues/9905).

I think if we do away with (3) (https://github.com/w3c/csswg-drafts/issues/10070#issuecomment-1995165143), having it `type` where we can is equivalent with existing things (class, view-transition-class, font-family, part...). We use `typeList` only because the word `type` is overused and sometimes conflicting (e.g. in `CSSViewTransitionRule`).

So I think using `type` in CSS but `typeList` in JS when it's a `DOMTokenList` is consistent enough with current things. But I'm happy to resolve on whatever we reach consensus around.


-- 
GitHub Notification of comment by noamr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10070#issuecomment-1998251585 using your GitHub account


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

Received on Thursday, 14 March 2024 19:23:44 UTC