Philosophy question - Bootstrap 4 vs. 5 conflict

Development philosophy question…..I have that has some blocks and single pages that are used to meet the requirements of the package which are built around bootstrap 5. however, my client has selected a theme which employs bootstrap 4and there are some conflicts.

Has anyone else bumped into this? How have you mitigated it?

Assuming the theme CSS is correctly scoped to .ccm-page, the issues should be limited to the views.

In most cases, BS4 and BS5 are not that different, so many views coded with BS5 in mind will look close enough in BS4.

There are 2 strategies you can follow to patch up the gaps

a) Create a supplementary style sheet scoped to .ccm-page that fills in with approximations of the missing BS5 classes.

b) Create alternate templates for the affected blocks.

This is the kind of problem an AI can be useful with. A prompt such as:

”Given this code which uses Bootstrap5, convert it to use Bootstrap4. Where practical, use classes that will work with both versions of Bootstrap. Make no changes other than those necessary for adapting the Bootstrap version. <<.. paste in your existing block view..>>”

@JohntheFish those are some really good suggestions thanks…and appreciate the notes.

I’m seeing the problems both in block views and single page views but mostly having to do with flexbox layouts and how accordions are handled. I’ve setup my stuff to work well with any bedrock theme for layout/features it just seems that in this case the selected theme isn’t a bedrock theme.

I think you’re right that converting my stuff to work in either 4 or 5 is going to be the best way to go in this case….although i’ve asked the theme author if they have any plans to convert :wink:

Thanks for taking the time to write.