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

Reduce CSS size / dynamic loading #47

Closed
fmannhardt opened this issue Feb 17, 2020 · 5 comments
Closed

Reduce CSS size / dynamic loading #47

fmannhardt opened this issue Feb 17, 2020 · 5 comments
Labels

Comments

@fmannhardt
Copy link

@fmannhardt fmannhardt commented Feb 17, 2020

Thanks for this nice package. Looks and works great, Would it be possible to use dynamic loading of the CSS files (or embed them in the page) to only include those that are actually needed?

The core CSS file has about 140 KB which is a lot only for displaying loading bars.

@JohnCoene
Copy link
Owner

@JohnCoene JohnCoene commented Feb 17, 2020

Yes! It had not occurred to me but makes of course complete sense. Let me work on that.

JohnCoene added a commit that referenced this issue Feb 17, 2020
JohnCoene added a commit that referenced this issue Feb 17, 2020
@JohnCoene
Copy link
Owner

@JohnCoene JohnCoene commented Feb 17, 2020

So. I can't actually dynamically load the CSS based on the spinner user. Perhaps something could be hammered together with JavaScript but it would not be clean. So instead I allow loading just the necessary files. I have the idea detailed here in the docs.

Essentially you can reduce the load size of the CSS files in use_waiter which now takes a spinners argument to which one can specify any of 7 spinner CSS kits, by default all kits are loaded so nothing breaks. You can know which kits should be specified by simply typing the spinner in the console, e.g.: spin_rotating_plane()

@fmannhardt
Copy link
Author

@fmannhardt fmannhardt commented Feb 17, 2020

Thanks for the very quick response. Works great. Only thing is that it now prints the message about which kit to use all the time. So, maybe this should be moved somewhere else or only when called from the console?

JohnCoene added a commit that referenced this issue Feb 17, 2020
JohnCoene added a commit that referenced this issue Feb 17, 2020
@JohnCoene
Copy link
Owner

@JohnCoene JohnCoene commented Feb 17, 2020

Yes, indeed, that was annoying! I just fixed that.

JohnCoene added a commit that referenced this issue Feb 17, 2020
JohnCoene added a commit that referenced this issue Feb 17, 2020
@JohnCoene
Copy link
Owner

@JohnCoene JohnCoene commented Feb 18, 2020

I'm going to close this for now as I think this has been addressed, though admittedly further segmentation of the CSS can be done. Thank you for raising this issue.

@JohnCoene JohnCoene closed this Feb 18, 2020
JohnCoene added a commit that referenced this issue Mar 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.