A partial archive of discourse.wicg.io as of Saturday February 24, 2024.

How to define type of custom variables

acterhd
2016-07-31

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

simevidas
2016-07-31

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

acterhd
2016-07-31

For example, CSS animation with variables.

iank
2016-08-01

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