mithril.d.ts icon indicating copy to clipboard operation
mithril.d.ts copied to clipboard

Types for vnode style attribute

Open panoply opened this issue 4 years ago • 0 comments

We could leverage csstype and provide typings on the vnode inline style attribute. Mithril supports hyphen and camelCase CSS properties both of which are covered in csstype.

Basic Example

import { StandardProperties, StandardPropertiesHyphen  } from "csstype";

interface IStyle extends StandardProperties, StandardPropertiesHyphen {}

 interface Attributes extends Lifecycle<any, any> {
    // ...
    style?: IStyle;
  }

Personally feels little much for some intellisense features like completions and checks. I would hypothesize users are not readily reaching for style attributes but given developers tend to expect this type of thing nowadays, might be a discussion point at the very least.

panoply avatar Sep 23 '21 23:09 panoply