Skip to content

Docs: handle deprecated dark variants more precisely#39291

Open
julien-deramond wants to merge 1 commit into
mainfrom
main-jd-handle-deprecated-dark-variants
Open

Docs: handle deprecated dark variants more precisely#39291
julien-deramond wants to merge 1 commit into
mainfrom
main-jd-handle-deprecated-dark-variants

Conversation

@julien-deramond
Copy link
Copy Markdown
Member

@julien-deramond julien-deramond commented Oct 12, 2023

Closes #40566

Description

This PR aims to handle deprecated dark variants more precisely in our documentation; in the components pages, in the examples and in the tests:

  • .btn-close-white
  • .carousel-dark
  • .dropdown-menu-dark
  • .navbar-dark
  • .text-bg-black (for Offcanvas)

This PR has voluntarily not been split as having all the elements at once makes it easier to determine consistency through the pages.

The global idea is to get rid of the dark variants everywhere in the code and replace their usage with data-bs-theme="dark" (even in dark variant descriptions) so that we can have a consistent rendering everywhere, and only show the new way of doing things.

Some new callouts have been added to the documentation to explain the changes where it was necessary.

.btn-close-white

.btn-close-white has been replaced with data-bs-theme="dark" in:

.carousel-dark

.carousel-dark has been replaced with data-bs-theme="dark" in:

.dropdown-menu-dark

.dropdown-menu-dark has been removed and data-bs-theme="dark" added at the .dropdown level in:

  • Dropdowns > Dark dropdowns (rendering can be compared with the previous one).
    • Please note that the rendering in this example is not exactly the same as the contextual dark mode version is darker than the dark variant. The color matches .btn-dark and not really .btn-secondary anymore.
Dark mode (now) Dark variant (before)
Screenshot 2023-10-19 at 08 37 43 Screenshot 2023-10-19 at 08 37 48

.navbar-dark

.navbar-dark has been replaced with data-bs-theme="dark" in:

Please note that .btn-success have been replaced with .btn-outline-success in some places has it was the rendering suggested in some of the examples for a better contrast.

The only difference we can see in the rendering in each and every case is the background color of the dropdowns and inputs which are now using the dark theme color instead of being white. This is linked to #38973 and my corresponding comment. I think right now, for the sake of consistency, we should keep the dark theme color for the dropdowns in this PR so that our documentation remains consistent everywhere.

.text-bg-black (for Offcanvas)

.text-bg-black has been replaced with data-bs-theme="dark" in:

Motivation & Context

Consistency throughout the documentation.

Type of changes

  • Enhancement (non-breaking change which fixes an issue)

Checklist

  • I have read the contributing guidelines
  • My code follows the code style of the project (using npm run lint)
  • My change introduces changes to the documentation
  • I have updated the documentation accordingly
  • (N/A) I have added tests to cover my changes
  • All new and existing tests passed

Live previews

@julien-deramond julien-deramond force-pushed the main-jd-handle-deprecated-dark-variants branch from dc4703a to f81365b Compare October 19, 2023 06:55
@julien-deramond julien-deramond marked this pull request as ready for review October 19, 2023 06:57
Copy link
Copy Markdown
Member

@louismaximepiton louismaximepiton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we try to use {{< callout-deprecated-dark-variants ... >}} everywhere in the documentation ? Would bring more consistency over the doc imo. If yes, need to change inside https://deploy-preview-39291--twbs-bootstrap.netlify.app/docs/5.3/components/close-button/#dark-variant and https://deploy-preview-39291--twbs-bootstrap.netlify.app/docs/5.3/components/navbar/#color-schemes.

On CSS side (so might be done afterwards), I think the difference you see between .dropdown-menu-dark and using data-bs-theme is mainly due to lack of consistency between CSS files (just compared _carousel.scss, _navbar.scss and _close.scss that still use $*-dark variables and _dropdown.scss that don't use them anymore). I don't know which one we should apply everywhere.

However, the global result is better than what was already there before.

Comment thread site/layouts/partials/docs-navbar.html
Copy link
Copy Markdown
Member

@mdo mdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine by me!

@mdo mdo added this to v5.4.0 Apr 3, 2025
@mdo mdo removed this from v5.3.4 Apr 3, 2025
@github-project-automation github-project-automation Bot moved this to Needs review in v5.4.0 Apr 3, 2025
@mdo
Copy link
Copy Markdown
Member

mdo commented Apr 3, 2025

Moving this to v5.4.0 because this changes a good amount of components, want to make sure it's seen properly.

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

Projects

Status: Needs review

Development

Successfully merging this pull request may close these issues.

Inconsistent handling of deprecated dark variants examples

3 participants