wagtail / sphinx-wagtail-theme

Wagtail's documentation theme for Sphinx
https://sphinx-wagtail-theme.readthedocs.io/
MIT License
30 stars 29 forks source link

Upgrade Bootstrap to version 5 #254

Open lb- opened 1 year ago

lb- commented 1 year ago

Currently the Theme is using Bootstrap 4 and it would be good to upgrade to version 5.

Split from #252 / #250

Bootstrap 5 did remove jquery as a dependency. Not sure how broken that would be to upgrade, or if it would be a mostly drop-in replacement given our minimal bootstrap usage. https://getbootstrap.com/docs/5.2/migration/ _Originally posted by @vsalvino in https://github.com/wagtail/sphinx_wagtail_theme/issues/252#issuecomment-1460813826_

It may be worth considering a small clean up of unused styles in the process. See https://github.com/wagtail/sphinx_wagtail_theme/issues/64

dassudip2001 commented 1 year ago

it used Bootstrap CDN ??

lb- commented 1 year ago

It's a front-end dependency see https://github.com/wagtail/sphinx_wagtail_theme/blob/main/package.json#L23

dassudip2001 commented 1 year ago

Screenshot from 2023-03-13 09-44-18

i can fix it ? can i send a PR

lb- commented 8 months ago

Just a thought. Is it worth looking at something more lightweight instead of Bootstrap.

Maybe too lightweight - https://open-props.style/ - but super flexible with CSS Custom Properties as the core method of designs.

Not sure on other options, maybe we need to review the actual Bootstrap parts used.

Also need to consider the ability to customise and override things for others.

thibaudcolas commented 3 weeks ago

As part of #299, I have started splitting the Bootstrap import into per-component imports, so we can start to remove the parts of Bootstrap which we don’t use. There are a lot of low-hanging fruits there I assume, though definitely also a case for just rebuilding it all together with another CSS framework.

vsalvino commented 3 weeks ago

The theme is pretty simple, I would argue to not use any framework. Bootstrap could probably be replaced with 100 lines of vanilla CSS at this point (i.e. replicate/copy the few classes we use from Bootstrap - containers, rows, collapse, button). Much less maintenance will be required this way. Most of the theme is already using custom CSS and very few Bootstrap classes anyhow.

Using a JS build framework is also probably unnecessary, as it is contained in a single file with 1 import - autocompleter could probably be imported a using normal script tag.

That setup would be mostly "set it and forget it" and also make it easier for juniors/newbies/python devs to help maintain and fix bugs.