Open
Description
I'm looking to do something akin to creating constant custom properties for things like style guides, and I thought I was going to be clever hacking it with syntax
but that doesn't work for items like colors where I still want browsers to know the property is a color not just a random ident. Ideally, I'd be able to do something like the following:
CSS.registerProperty({
name: '--my-blue',
syntax: '<color>',
inherits: true,
allowedValues: ['#4285f4'],
});
CSS.registerProperty({
name: '--highlight-color',
syntax: '<color>',
allowedValues: ['#4285f4', '#ea4335', '#fbbc04'],
initialValue: '#4285f4',
});
Alternatively to this, providing a validation hook that could either be created at registration time or picked up in JavaScript later if using the @property
syntax