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

Allow functions to be added as styles in head #2377

Merged
merged 7 commits into from
Nov 24, 2021
Merged

Conversation

vidhu
Copy link
Contributor

@vidhu vidhu commented Oct 18, 2021

This is in response to #2374

it essentially allows you to add functions as styles from head component which are then evaluated in during rendering in the skeleton

i.e

add("style", (breakpoint) => `
    ...
`);

@iRyusa
Copy link
Member

iRyusa commented Oct 20, 2021

Maybe we should pass all the options ?
👍 GJ for the PR and adding test to this 🙌

@vidhu
Copy link
Contributor Author

vidhu commented Oct 21, 2021

Maybe we should pass all the options ? 👍 GJ for the PR and adding test to this 🙌

@iRyusa I did think about that but realized that it would be inconsistent with headStyle(breakpoint) and componentHeadStyle(breakpoint) function signature. We could change both places to be consistent but then that would be a backward incompatible change.

Not really sure what's the best approach.

Maybe in a separate PR, we could add a new function on the Component class to get the globalDatas

Let me know what you think

To match with eslint-airbnb-base expected path naming convention. Solves the false possitives for the "import/no-extraneous-dependencies" rule
@vidhu
Copy link
Contributor Author

vidhu commented Oct 28, 2021

Hey @iRyusa Could you trigger the github workflow for this PR?

@iRyusa
Copy link
Member

iRyusa commented Nov 3, 2021

Yup sorry for that delay cc @kmcb777 can we release this soon ?

@kmcb777
Copy link
Collaborator

kmcb777 commented Nov 24, 2021

LGTM 👍 thanks for this PR

@kmcb777 kmcb777 merged commit a7fa86e into mjmlio:master Nov 24, 2021
@kmcb777
Copy link
Collaborator

kmcb777 commented Nov 24, 2021

@vidhu it has just been released in 4.11.0

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

Successfully merging this pull request may close these issues.

3 participants