How to define type of custom variables


#1

Hello. I have questions. How to declare custom type of custom CSS variables? Also, browsers (include chrome) never will support CSS4 and CSSOM specifications?


#2

Why would you need to declare a type? Could you give an example use case?


#3

For example, CSS animation with variables.


#4

This is going to be possible with the Houdini Properties and Values API

E.g.

CSS.registerProperty({
  name: '--my-color',
  syntax: CSSColorValue,
  inherits: false,
  initial: 'red',
});

Thanks, Ian