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

Optimize Icon Box Shadow #205

Closed
jjspace opened this issue Dec 18, 2018 · 2 comments
Closed

Optimize Icon Box Shadow #205

jjspace opened this issue Dec 18, 2018 · 2 comments
Assignees
Labels
enhancement New feature or request waiting - contributor Waiting for the contributor to address some situations

Comments

@jjspace
Copy link
Contributor

jjspace commented Dec 18, 2018

The Problem
Our current solution for creating icons from box shadows creates a very large css output especially in regards to duplicating essentially the same box-shadow for each of the 4 sizes we offer.

A Solution
Optimize the css output so there is only one box shadow specified for each icon regardless of size. I found a way to ensure that icons are scalable utilizing em sizing instead of px sizes which will allow us to compile one box-shadow (2 if you count -moz) per icon and just adjust the size of elements as necessary. I've created a POC here which shows how easy it is to make icons any size we want. This is dependent on the font-size property but since all our icons are in pseudo (::before or ::after) elements that wont be a factor.

I will create a PR for this later tonight so it can be tested more throughly. Since there are currently 4 sizes for each icon I'm expecting this change to allow the size of the compiled css of icons to be 1/3 or 1/4 of the current size 😄

@guastallaigor guastallaigor added enhancement New feature or request waiting - contributor Waiting for the contributor to address some situations labels Dec 18, 2018
jjspace added a commit to jjspace/NES.css that referenced this issue Dec 19, 2018
jjspace added a commit to jjspace/NES.css that referenced this issue Dec 19, 2018
jjspace added a commit to jjspace/NES.css that referenced this issue Dec 20, 2018
@trezy
Copy link
Member

trezy commented Dec 20, 2018

@jjspace Can you confirm that this issue was resolved by the merge of #215?

@jjspace
Copy link
Contributor Author

jjspace commented Dec 20, 2018

Yes, This was resolved by PR #215. Sorry I forgot to update the issue

@jjspace jjspace closed this as completed Dec 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request waiting - contributor Waiting for the contributor to address some situations
Projects
None yet
Development

No branches or pull requests

3 participants