Closed frenic closed 3 years ago
@cobalt-medma I moved your question to a separate issue because it didn't have anything to do with the original issue.
This one is tricky. I haven't found a way to modify existing properties using module augmentation. But first off; if a value is missing (except for CSS Custom Properties) we need to make sure the MDN data is corrected.
Alternatively you can use type assertion to temporarily solve your issue. Here's an example:
const style: CSS.Properties = {
['fontWeight' as any]: 'medium',
};
@frenic It's not that a type is missing but that I'm using xstyled which has some transformation. If I write 'medium' or 'something' it would replace it with a value defined in my theme. But my theme defined props like medium and light.
In that case I think you should open this question to xstyled
What if I wanted to modify the type definition of a prop, for example "fontWeight"? I tried the following but it's not working. Maybe because of my lack of typescript knowledge.
Originally posted by @cobalt-medma in https://github.com/frenic/csstype/issues/63#issuecomment-831276507