Skip to content

Remove Bootstrap from the codebase #52030

Closed

Description

@Sboonny

The following tasks will finalize our departure from react-bootstrap our component library:

### Remaining components
- [x] Replace Button Component - https://github.com/freeCodeCamp/freeCodeCamp/issues/52092
- [x] Create Modal Component - https://github.com/freeCodeCamp/freeCodeCamp/pull/54044
- [x] Progress Bar Component - #52011
- [ ] #52759
### `ui-components`
- [x] Package the current Storybook preview resetters with the component library
- [x] Replace the preview resetters with a recent copy or a complete copy of normalizeCSS, resetCSS, or the default tailwind set - https://github.com/freeCodeCamp/ui/pull/114
- [x] Move the `@freecodecamp/ui/dist/base.css` import to an outer layer https://github.com/freeCodeCamp/freeCodeCamp/blob/523f4de26f7e6614041179b3ab3e2bd196b02263/client/src/components/solution-display-widget/index.tsx#L10 - #55068
### Remove Bootstrap
- [x] Remove @freecodecamp/react-bootstrap as a dependency - #54289
- [x] Remove bootstrap.min.css injection. - #55068
### Clean up
- [ ] Migrate usages of native elements in /learn to `ui-components`.
- [x] Move UI Components to its repo.
- [ ] Remove `img-responsive` class usages as it is the default (in Tailwind preflight) - #55190
- [ ] Removed CSS rules that are to override Bootstrap styles.

Activity

  1. added
    platform: learn
    on Oct 20, 2023
  2. locked as spam and limited conversation to collaborators on Oct 20, 2023
  3. deleted a comment from ahmaxed on Oct 20, 2023
  4. deleted a comment from ddddami on Oct 20, 2023
  5. pinned this issue on Oct 20, 2023
  6. unlocked this conversation on Oct 20, 2023
  7. locked and limited conversation to collaborators on Oct 20, 2023
  8. unpinned this issue on Mar 11, 2024
  9. changed the title [-]Remove bootstrap from the codebase[/-] [+]Remove Bootstrap from the codebase[/+] on Apr 4, 2024
  10. huyenltnguyen commented on Apr 5, 2024

    @huyenltnguyen
    Member

    @ahmaxed I'm looking into the Bootstrap stylesheet removal, and would like to double check the strategy with you to ensure I understand things correctly.

    In order to remove the Bootstrap stylesheet, we need to do the following steps:

    • Have an official version of our reset/normalize stylesheet in @freecodecamp/ui
    • Include the normalize stylesheet in the package bundle
    • Replace the Bootstrap stylesheet with the @freecodecamp/ui one, check and fix any UI issues introduced by the change
    • Remove CSS rules that were previously needed to override Bootstrap from global.css (I think this work would need to be done at the same time as the migration of native HTML elements, since we still need the styles in global.css for these at the moment)

    Does the list look correct to you? Is there anything I missed?

    There are still some implementation details that I'm a little unsure, but I think it's easier to discuss on a PR, where we have the code to look at.


    cc'ing @Sembauke.

  11. ahmaxed commented on Apr 5, 2024

    @ahmaxed
    Member

    The is correct. Here are some insights:

    I locally replaced the minified bootstrap file with minified normalize.css v8.0.1, and things look fine :)
    There are some missing element paddings here and there, since some elements use bootstrap classes (.btn, etc) for styling.
    So one actionable item should be removing/restyle bootstrap classes before we remove bootstrap.
    We are adding the ui-comopnents stylesheet as @freecodecamp/ui/dist/base.css. I will leave it to you to decide where to properly place it and if it needs to be injected in the head.

  12. self-assigned this
    on Apr 9, 2024
  13. huyenltnguyen commented on May 23, 2024

    @huyenltnguyen
    Member

    (This is my working notes, please ignore)

    Details

    Bootstrap classes

  14. huyenltnguyen commented on Jun 14, 2024

    @huyenltnguyen
    Member

    The remaining items are:

    1. Removing the img-responsive class
    2. Migrating native elements to @freecodecamp/ui
    3. Removing Bootstrap overrides

    • (1): will be addressed via fix(client, curriculum): center images in challenge description #55190.
    • (2): We have migrated those that were blocking the Bootstrap removal. The remaining elements can be migrated gradually and opportunistically. Also note that there are a couple of components in /client that don't have a replacement in @freecodecamp/ui (the CTA button is an example), so we will need to continue with the library development as well, in order to enable the migration.
    • (3): I did remove a handful of Bootstrap overrides during the removal. There are some rules that still need to stay in order to style the native elements – those in (2) that we are not able to migrate yet. The cleanup of those rules will be part of the next round of component migration.

    I'm closing this issue as the work needed for the Bootstrap removal has been completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

platform: learn

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions