Skip to content

[#135] Change direction of composition in propsModifier #144

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

Closed
wants to merge 1 commit into from

Conversation

arthurxavierx
Copy link
Contributor

No description provided.

@arthurxavierx arthurxavierx force-pushed the arthur/refactor/props-modifier branch from bf1f7b6 to e84ae14 Compare May 1, 2020 15:11
@arthurxavierx
Copy link
Contributor Author

@hdgarrood @spicydonuts I'm closing out this PR since it does sort of the opposite of what we want. The direction of composition of propsModifier currently works fine:

button
$ _linkStyle
$ _secondary
$ propsModifier _ { content = [ hello ] }
$$$ [ goodbye ]

currently gives us a secondary button with "goodbye" as its content, whereas after this PR, we have a link-style button with "hello" as the content.

The behavior that we were seeing and that led to the creation of #135 is due to a bug in the definition of styleModifier. It currently reads as:

styleModifier :: (LumiTheme -> Emotion.Style) -> StyleModifier
styleModifier f = propsModifier \props -> props { css = f <> props.css }

but the f override should take precedence over the element's current styling, hence why part of this line needs changing to props.css <> f. That fixes the problem described in #135 while keeping the desired direction of composition for props modifiers.


I've added the needed fixes to #145.

@hdgarrood
Copy link
Contributor

Sounds good to me!

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.

4 participants