Docs: handle deprecated dark variants more precisely#39291
Docs: handle deprecated dark variants more precisely#39291julien-deramond wants to merge 1 commit into
Conversation
07d8f6d to
af82a3b
Compare
dc4703a to
f81365b
Compare
louismaximepiton
left a comment
There was a problem hiding this comment.
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.
|
Moving this to v5.4.0 because this changes a good amount of components, want to make sure it's seen properly. |
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-whitehas been replaced withdata-bs-theme="dark"in:.carousel-dark.carousel-darkhas been replaced withdata-bs-theme="dark"in:.dropdown-menu-dark.dropdown-menu-darkhas been removed anddata-bs-theme="dark"added at the.dropdownlevel in:.btn-darkand not really.btn-secondaryanymore..navbar-dark.navbar-darkhas been replaced withdata-bs-theme="dark"in:data-bs-theme="dark"has not been added at the navbar level since it's already present at the<header>level)data-bs-theme="dark"has not been added at the navbar level since it's already present at the<header>level)-rtl/#navbar))
data-bs-theme="dark"has not been added at the navbar level since it's already present at the<header>level)data-bs-theme="dark"has not been added at the navbar level since it's already present at the<header>level)js/tests/visual/modal.html(rendering can only be compared locally but follows the same logic as the previous use cases)js/tests/visual/scrollspy.html(rendering can only be compared locally but follows the same logic as the previous use cases)Please note that
.btn-successhave been replaced with.btn-outline-successin 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-blackhas been replaced withdata-bs-theme="dark"in:Motivation & Context
Consistency throughout the documentation.
Type of changes
Checklist
npm run lint)Live previews