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

Move post thumbnail box shadow to inline CSS instead of plain style #1989

Closed
abaicus opened this issue Sep 3, 2020 · 1 comment
Closed
Assignees
Labels
performance & speed Performance and speed released Indicate that an issue has been resolved and released in a particular version of the product. small enhancement Small feature or change

Comments

@abaicus
Copy link
Collaborator

abaicus commented Sep 3, 2020

Right now we use static CSS for the post thumbnail box-shadow.

The size of this clocks in at a little above half a kilobyte. This should be generated dynamically, not with static CSS.

I'm sure we can find a way to calculate 5 steps for it, saving us 500bytes in the process. 🙈

Later Edit: We can even do it with a static array mapping.

With

image

Without

image

.nv-shadow-1 .nv-post-thumbnail-wrap{box-shadow:0 1px 3px -2px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.1)}.nv-shadow-2 .nv-post-thumbnail-wrap{box-shadow:0 3px 6px -5px rgba(0,0,0,.1),0 4px 8px rgba(0,0,0,.1)}.nv-shadow-3 .nv-post-thumbnail-wrap{box-shadow:0 10px 20px rgba(0,0,0,.1),0 4px 8px rgba(0,0,0,.1)}.nv-shadow-4 .nv-post-thumbnail-wrap{box-shadow:0 14px 28px rgba(0,0,0,.12),0 10px 10px rgba(0,0,0,.12)}.nv-shadow-5 .nv-post-thumbnail-wrap{box-shadow:0 16px 38px -12px rgba(0,0,0,.56),0 4px 25px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.2)}

image

@pirate-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 2.8.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance & speed Performance and speed released Indicate that an issue has been resolved and released in a particular version of the product. small enhancement Small feature or change
Projects
None yet
Development

No branches or pull requests

2 participants