Skip to content

Automatic conversion of number to string in declaration values #1373

@K3TH3R

Description

@K3TH3R

@ai asked me to open up an issue after he helped me to understand that an error I was encountering was being caused by setting a declaration value with a number instead of a string:

const paddingTop = postcss.decl({ prop: 'top', value: 0 })

This would in turn throw the following error: TypeError: decl.value.indexOf is not a function

I believe the idea we discussed would be to automatically cast number values to strings to improve DX in a case like this rather than throwing an error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions