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

Alpha shadows generation #5

Open
ugudango opened this issue Feb 16, 2021 · 2 comments
Open

Alpha shadows generation #5

ugudango opened this issue Feb 16, 2021 · 2 comments

Comments

@ugudango
Copy link

I've been recently playing with luminance differences, and made an npm package that also generates alpha shades (black or white, with a certain opacity). It generates solid shades too, but I see you've taken care of that already.

I think this website could benefit from alpha shadows, since it's more common to have the box-shadow property set to something not fully opaque (as overlaps would look weird - overlapping shadows wouldn't be darker).

Since it's not a package (or something storage-critical), but just a website, I don't think there's any harm to adding extra dependencies for this utility. If you would consider this to be a good idea as well, I could PR that change.

If, however, you'd rather not add to the dependencies list, you could take a look at the mini-package I made to write it yourself faster.

@adamgiebl
Copy link
Owner

I've thought about this too and the points that you give are valid. From my experience, the opaque shadows (with calculated color) look much better in certain conditions, on the other hand, the shadows that you are referring to also provide a better result under different conditions.

I decided to go with these shadows because they seemed to give me a better result most of the time. In the ideal scenario, I would have an algorithm that would determine which shadow to use, but not sure if that's possible.

We could give the user a choice of which shadow to use, but that would complicate the UI a bit and I think most of the users wouldn't know what's the difference between the two choices.

Do you have any ideas on how to solve this with the UX in mind?

@adamgiebl
Copy link
Owner

But for now, you are definitely welcome to fork the repo and try to implement the shadow generation with your library. If the results convince me I would adopt the change here, or you could open a PR. Would be interesting to see.

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

No branches or pull requests

2 participants