openlibrary icon indicating copy to clipboard operation
openlibrary copied to clipboard

Remove iconochive

Open cdrini opened this issue 9 months ago • 5 comments

We include a decent amount of iconochive CSS which we don't use ; we don't use iconochive anywhere. Let's delete it.

Files to delete:

  • static/css/components/iconochive.less
  • static/fonts/Iconochive-*

References to delete (delete just where iconochive is mentioned not the whole file):

  • static/css/legacy.less
  • static/css/less/font-families.less

Evaluation:

  • Before doing the deletions, do a make less and then run du -sh static/build/page-*.css. Then do the deletions, run the two commands again, and compare the sizes!
  • Also update bundlesize.config.json for the css files to be the new size +1 kb.

cdrini avatar May 13 '24 13:05 cdrini

I'd like to grab this ✋

danwoods avatar May 15 '24 19:05 danwoods

Playing with getting the repo setup and encountering the following issues after getting things running in Docker and building the assets (via docker compose run --rm home npm run build-assets):

Running make less from the top level directory returns make: *** No rule to make target less'. Stop.Runningdu -sh static/build/page-.cssfrom the top level directory returnsdu: static/build/page-.css: No such file or directory`

danwoods avatar May 15 '24 22:05 danwoods

Hi, @danwoods:

I think Drini may have meant to run make css first, though if you run that outside of the container it may rely on something you don't have and may not want to install (parallel).

If you run make less inside the container it will work, but you'll need to have the container running and use docker compose exec for this, as doing docker compose run will I think not persist, though I may be wrong. E.g.:

❯ docker compose exec web bash
WARN[0000] The "HOST" variable is not set. Defaulting to a blank string. 
openlibrary@48c15bb0e470:/openlibrary$ make css
mkdir -p static/build
parallel --verbose -q npx lessc {} static/build/{/.}.css --clean-css="--s1 --advanced" ::: static/css/page-admin.less static/css/page-barcodescanner.less static/css/page-book-widget.less static/css/page-book.less static/css/page-design.less static/css/page-dev.less static/css/page-edit.less static/css/page-form.less static/css/page-home.less static/css/page-list-edit.less static/css/page-lists.less static/css/page-plain.less static/css/page-subject.less static/css/page-team.less static/css/page-user.less
npx lessc static/css/page-admin.less static/build/page-admin.css '--clean-css=--s1 --advanced'
npx lessc static/css/page-barcodescanner.less static/build/page-barcodescanner.css '--clean-css=--s1 --advanced'
[...]

You probably also need to run the du command inside the container too. That said, you won't be able to delete from within the container, so do that outside.

So the capsule summary is run make css and du inside the container, and delete and edit files outside. Deletions and edits outside should be should be immediately reflected inside. Also, probably use git rm to make things easier.

Please follow up with any questions, and hopefully I have not led you further astray. :)

scottbarnes avatar May 16 '24 04:05 scottbarnes

Thanks @scottbarnes! Will check this out 👍

danwoods avatar May 16 '24 16:05 danwoods

I don't know why I said using docker compose run probably wouldn't work, because I think it probably would. Either way one or both will. :)

scottbarnes avatar May 17 '24 13:05 scottbarnes