-
Notifications
You must be signed in to change notification settings - Fork 968
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
Allow not defaulting MjmlText color #1955
Comments
You can just ignore the validating message here ?
… On 23 Jun 2020, at 16:29, Omar Diab ***@***.***> wrote:
Is your feature request related to a problem? Please describe.
I have two "themes" in my emails, which I want to toggle on and off based on the presence of a CSS class - a dark and a light theme.
In the dark theme, all text should be light. In the light theme, all the text should be dark.
But MjmlText defaults the color CSS rule to #000000. Unfortunately since it uses the color type from mjml-core which uses regexes to detect hex codes and such, it also disables the potential for passing inherit as the value. so, I cant to disable this functionality.
Describe the solution you'd like
Either a) allow passing inherit as the value to MjmlText assuming that's well supported or b) allow disabling the setting of color altogether, neither of which would be backwards-incompatible
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I'm preferring to use strict mode as part of my testing, I don't want to have to give up validation of my entire project just so that I can deal with one missing part of this library. I'd be happy to add a PR, but which of my suggestions if either would you like? |
Then you can open a PR here : https://github.com/mjmlio/mjml/blob/master/packages/mjml-core/src/types/helpers/colors.js adding inherit. mj-all doesn't validate the attribute type, so if you pass color on it it won't be listed as an error for now. For compatibility issue you should still use inline styles over class to maximize support. |
|
Is your feature request related to a problem? Please describe.
I have two "themes" in my emails, which I want to toggle on and off based on the presence of a CSS class - a dark and a light theme.
In the dark theme, all text should be light. In the light theme, all the text should be dark.
But
MjmlText
defaults thecolor
CSS rule to#000000
. Unfortunately since it uses thecolor
type frommjml-core
which uses regexes to detect hex codes and such, it also disables the potential for passinginherit
as the value. so, I cant disable this functionality.Describe the solution you'd like
Either a) allow passing
inherit
as the value toMjmlText
assuming that's well supported or b) allow disabling the setting ofcolor
altogether, neither of which would be backwards-incompatibleThe text was updated successfully, but these errors were encountered: