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

Drop shadow effects: how to support multiple shadows in one effect? #11

Closed
JeroenRoodIHS opened this issue Jan 17, 2024 · 8 comments
Closed
Labels
enhancement New feature or request

Comments

@JeroenRoodIHS
Copy link
Contributor

As the title says: I am wondering how I could support multiple shadows in one drop shadow effect. I take cues from Material Design with supporting shadows: they have three shadows for one definition of elevation, which I derived my own set of drop shadow effects from:

image

Currently, only one of the drop shadows ends up in my tokens.json file.

image

Is it possible to support multiple drop shadows in my tokens.json?

@JeroenRoodIHS
Copy link
Contributor Author

I thought to myself: why not looking at the code, to see if multiple drop shadows are supported already, and I am not missing something. Turns out that only one part of an effect is considered, by selecting effect[0], rather than considering the drop shadow effect as an array.

I am not aware of how effects are passed to the plugin, but I assumed that any drop shadow would be an entry of the effect array. That is why I forked this repo and created a PR to submit a suggestion for handling the drop shadow effects.

This is my PR: 35acf36

Please do note that a guide for contribution to this repo is still WIP. I don't know how to properly contribute to this repo. Consider my PR as a suggestion, and use it whichever way you like to. I think that treating the drop shadow effects as arrays and exporting them as such may be the best way to go.

I am curious to any feedback.

@dev-nicolaos
Copy link
Contributor

Agreed it'd be good support multiple shadows in the same token. I know its already been linked to in the PR, but for those searching in the future here is the relevant spec issue.

It looks like Cobalt implemented support for this recently. It'd be nice if the implementation was interoperable.

@PavelLaptev
Copy link
Collaborator

PavelLaptev commented Feb 5, 2024

Just merged this PR #12
New version in Figma also published.

@PavelLaptev PavelLaptev added the enhancement New feature or request label Feb 5, 2024
@dev-nicolaos
Copy link
Contributor

Looks like the release (0b64358) that implemented this fix didn't get tagged in GitHub. I don't know if anyone consumes the package that way so its not a huge deal. However, this does mean the repo's homepage looks misleading since the other releases were tagged. The "Releases" section on the right still shows 2.0.0 as being the most recent release.

Other than that, it looks like this issue could be closed.

@PavelLaptev
Copy link
Collaborator

You right, that's my bad. I'll fix it asap

@PavelLaptev
Copy link
Collaborator

@dev-nicolaos
Copy link
Contributor

Nice! I think this issue can get closed then.

@JeroenRoodIHS
Copy link
Contributor Author

Sorry for the delay. Indeed, this issue can be closed. Support for multiple shadows has been implemented.

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

No branches or pull requests

3 participants