emad-elsaid / rubyfunctions

Like Rubygems.org but for Ruby functions
https://www.rubyfunctions.com/
28 stars 15 forks source link

CSS bundle size #9

Open ahmadalfy opened 4 years ago

ahmadalfy commented 4 years ago

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

emad-elsaid commented 4 years ago

I can add it to package.js but I'm not sure that this will shake it removing the unused classes.

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.

AhmedFat7y commented 4 years ago

@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.

emad-elsaid commented 4 years ago

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