rubyfunctions icon indicating copy to clipboard operation
rubyfunctions copied to clipboard

CSS bundle size

Open ahmadalfy opened this issue 4 years ago • 3 comments

To be honest Bulma (or any other framework) seems like overkill for the project.

image

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

ahmadalfy avatar Mar 31 '20 11:03 ahmadalfy

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 avatar Mar 31 '20 15:03 emad-elsaid

@emad-elsaid There are 2 problems here

  1. CSS File is bloated with unused styles
  2. 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

  1. To purge the unused styles (using sth like THIS)
  2. 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.

AhmedFat7y avatar Apr 02 '20 19:04 AhmedFat7y

Nice, let's go with purging the unused css solution

emad-elsaid avatar Apr 03 '20 05:04 emad-elsaid