Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement bootstrap5 theme #2887

Closed
wants to merge 4 commits into from
Closed

Implement bootstrap5 theme #2887

wants to merge 4 commits into from

Conversation

nurikk
Copy link

@nurikk nurikk commented Jun 20, 2022

Implement bootstrap5 theme

This PR adds support for bootstrap5 theme. It 99.99% copy of bootstrap4 theme, but has following differences:

  1. This package depends on react-boostrap v2 (which enables support for bootstrap5) instead of v1
  2. This package depends on updated react-icons
  3. This package has slight changes in SelectWidget, to support react-boostrap v2

Resolves #2428

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests. I've run npm run test:update to update snapshots, if needed.
    • I've updated docs if needed
    • I've updated the changelog with a description of the PR
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

@heath-freenome
Copy link
Member

heath-freenome commented Jul 21, 2022

@nurikk Have you considered making this theme use the @rjsf/bootstrap-4 and simply override SelectWidget in the widgets... something like:

import { Theme } from '@rjsf/bootstrap-4';
import SelectWidget from `../src/SelectWidget`;

const Theme5: WithThemeProps = {
  ...Theme,
  widgets: { ...Theme.widgets, SelectWidget }
}

export Theme;

You might keep all of the tests but you won't need most of the source files. Because you are using the latest 2.x version of bootstrap, the imports in the bootstrap-4 version will actually pick up the v2 code as react-bootstrap is a peer-dependency and should supercede things.

@jochenschmich-aeberle
Copy link

Hi there, just asking for an indication, whether this pull request is going to be merged?

@heath-freenome heath-freenome added the v5 refactor Needs refactor due to v5 breaking changes label Feb 21, 2023
@heath-freenome
Copy link
Member

@jochenschmich-aeberle This PR will likely never be merged as it was made against a now very out-of-date v4 codebase. We are keeping it around as we are considering dropping support for bootstrap-4 in favor of bootstrap-5 when we officially support React 18 as part of the future v6 release. In the meantime, I believe that using the bootstrap-4 theme with bootstrap-5 is possible, assuming you fix the SelectWidget

@johan-smits
Copy link

Is there a tracking issue for BS5 implementation?

@heath-freenome
Copy link
Member

Is there a tracking issue for BS5 implementation?

@johan-smits Yes, it is #3638

@heath-freenome
Copy link
Member

@nurikk We are doing this in v6 with #3974

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v5 refactor Needs refactor due to v5 breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Bootstrap 5 theme
4 participants