Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type matcher configuration to accommodate specific use cases #2791

Open
fxfilmxf opened this issue Dec 6, 2023 · 2 comments
Open

Type matcher configuration to accommodate specific use cases #2791

fxfilmxf opened this issue Dec 6, 2023 · 2 comments

Comments

@fxfilmxf
Copy link

fxfilmxf commented Dec 6, 2023

Is your feature request related to a problem? Please describe.

We are attempting to use a templated value as a background color (in this case a handlebars-like string). However, when building our emails, we get an error from mjml: Attribute background-color has invalid value: <value> for type Color. This happens because the Color type in mjml has a list of matchers that looks for "real" color values such as a hex value or rgb value. For our use case, the built email will work just fine since there's additional processing that happens to render the actual email that is sent out.

Describe the solution you'd like
Ideally we could configure the Color type (and maybe any type) matchers to accommodate our use case. This way developers still get the default type checking while accommodating uses cases where the values are not known at build time.

Describe alternatives you've considered
Alternatives would be to build a mechanism that disables type checking either globally for a specific type, like Color, or on a per component basis.

@iRyusa
Copy link
Member

iRyusa commented Dec 6, 2023 via email

@fxfilmxf
Copy link
Author

fxfilmxf commented Dec 6, 2023

@iRyusa great, I'd be happy to open a PR. Thanks for validating the idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants