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

Add support for multiple box shadows on BoxShadow Modifier API #536

Conversation

rafaeltonholo
Copy link

@rafaeltonholo rafaeltonholo commented May 17, 2024

Currently, the BoxShadow Modifier API only supports a single shadow. This PR enables the API to receive multiple shadows or none, in case the user wants to remove a shadow in a variant style.

Copy link
Collaborator

@bitspittle bitspittle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR!

Phew, as you may have seen, 0.18.0 is finally out. Took quite a bit longer than I thought, so I wanted to say sorry for the delay.

Overall, this looks great, and I appreciate the time you spent on the header docs. I think we can get this into 0.18.1 fairly soon. There are some fixes that will have to happen first, but they should be fairly trivial, and hopefully helpful in understanding how nuanced this stuff can get sometimes.

Since this is our first time working together, just wanted to say feel free to ask questions or push back with your own suggestions anytime, happy to keep a dialog open.

@rafaeltonholo rafaeltonholo force-pushed the feature/modifier-box-shadow-with-multiple branch from cc1de93 to 555dde0 Compare May 20, 2024 18:05
@rafaeltonholo rafaeltonholo changed the base branch from 0.17.4 to 0.18.1 May 20, 2024 18:10
@rafaeltonholo rafaeltonholo force-pushed the feature/modifier-box-shadow-with-multiple branch from 555dde0 to a9b76b0 Compare May 20, 2024 18:11
@rafaeltonholo rafaeltonholo force-pushed the feature/modifier-box-shadow-with-multiple branch from a9b76b0 to 007ef3f Compare May 21, 2024 11:54
Copy link
Collaborator

@bitspittle bitspittle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, and thanks for your patience on the back and forth.

I can tell by your attention to detail that wherever you work or whatever you work on is lucky to have you.

You may be interested to hear that the discussions we had here about the "CSS-" prefix has actually caused us to reflect on the pattern more broady in our codebase, and it seems likely that the way I designed CSSTransition and CSSAnimation is wrong.

Note

CSSAnimation comes from Compose HTML but they screwed up their implementation, which is originally what caused me to introduce a fixed version of it into Kobweb, but now we're thinking Animation.of is more Kobweb idiomatic.

* }
* ```
*/
fun Modifier.boxShadow(vararg shadows: BoxShadow.Shadow): Modifier = styleModifier {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure what I feel about the name BoxShadow.Shadow but I certainly won't block the PR over it! We can easily tweak this name later if we come up with something else.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've named it Shadow because that's how W3C refers to that property value. However, MDN uses spread-shadow instead, which could also be an alternative. Since W3C defines the web standard, I prefer sticking with their name. But I understand that it looks quite ugly as BoxShadow.Shadow.

Now that I think about it, maybe I should name it BoxShadow.Property instead, which is similar to what you're already doing with the other properties in the project. If you'd like, I can create a small PR to address that, or we can leave it as is and address it later.

@bitspittle bitspittle merged commit d3483c0 into varabyte:0.18.1 May 21, 2024
1 check passed
@rafaeltonholo
Copy link
Author

rafaeltonholo commented May 22, 2024

Looks great, and thanks for your patience on the back and forth.

I can tell by your attention to detail that wherever you work or whatever you work on is lucky to have you.

You may be interested to hear that the discussions we had here about the "CSS-" prefix has actually caused us to reflect on the pattern more broady in our codebase, and it seems likely that the way I designed CSSTransition and CSSAnimation is wrong.

Note

CSSAnimation comes from Compose HTML but they screwed up their implementation, which is originally what caused me to introduce a fixed version of it into Kobweb, but now we're thinking Animation.of is more Kobweb idiomatic.

I'm glad that I could help with the project! I really like its idea and I hope I can contribute more in the future :)

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.

None yet

2 participants