rubyfunctions
rubyfunctions copied to clipboard
CSS bundle size
To be honest Bulma (or any other framework) seems like overkill for the project.
Unless you're using it with plans to use more components, you can purge the unused CSS or even better; write your own. If that's OK I can contribute to that as well
I can add it to package.js but I'm not sure that this will shake it removing the unused classes.
- I want to get rid of the parts I'm not using now
- I want this to happen dynamically while building the docker image so it's not hard coded so I won't forget about it if I used another part of the framework
- I also need to do this with the least code and dependencies possible, especially when it comes to NPM package.
these are the ideas in my mind, not sure what's the best approach here.
on one side I thought using the CDN to deliver the style is better for me so the project will have only 1 line to include the bulma style without pulling it on build time, so the current approach cut down build time on the expense on downloading the whole framework to the client.
I would like to hear your thoughts about how I can approach this with the least possible cost.
@emad-elsaid There are 2 problems here
- CSS File is bloated with unused styles
- CSS File's size is considerably huge
A CDN would help with delivering it faster, but the file size will remain the same.
What @ahmadalfy is suggesting is
- To purge the unused styles (using sth like THIS)
- To not use a CSS library/framework and to write your own.
The problem with the 2nd solution is that it will need maintenance and active contributions to keep it going. You can try the first solution first until it fails you I guess.
Nice, let's go with purging the unused css solution