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

Reopened: Missing $primary-text-emphasis-dark variable #39367

Closed
3 tasks done
Michael-Ziluck opened this issue Nov 3, 2023 · 7 comments · Fixed by #39380
Closed
3 tasks done

Reopened: Missing $primary-text-emphasis-dark variable #39367

Michael-Ziluck opened this issue Nov 3, 2023 · 7 comments · Fixed by #39380

Comments

@Michael-Ziluck
Copy link

Michael-Ziluck commented Nov 3, 2023

Clarification from original issue #38683

The original ticket was closed by @mdo with the following explanation:

Closing as this isn't a breaking change—minor releases can include new features. This has always been the case in Bootstrap.

There seems to be a misunderstanding on what "breaking change" means. It should mean: "if you update this library to a new version, all usages of said library should continue to compile."

Before version 5.3.0, the following code compiles:

@import "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
@import "bootstrap/scss/mixins/breakpoints";

After version 5.3.0, the aforementioned code throws the following error:

HookWebpackError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Undefined variable.
   ╷
55 │     "primary": $primary-text-emphasis-dark,
   │                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   ╵
  bootstrap\scss\_maps.scss 55:16  @import
  src\styles.scss 19:9             root stylesheet

If you disagree, can you please explain how you and the rest of the Bootstrap team interprets the phrase "breaking change"?

Original issue

Prerequisites

Describe the issue

The problem is your update a minor version (5.2.3 -> 5.3.0) and have a very little Breaking Change

variable $primary-text-emphasis-dark not exist on 5.2.3 and is required on 5.3.0

SassError: Undefined variable.
   ╷
55 │     "primary": $primary-text-emphasis-dark,
   │                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   ╵
  node_modules/bootstrap/scss/_maps.scss 55:16  @import
  src/styles.scss 9:9                           root stylesheet

The fix is very easy to implement, just need include the new file variables-dark on main styles

@import "../node_modules/bootstrap/scss/variables";
@import "../node_modules/bootstrap/scss/variables-dark";
 ...
@import "../node_modules/bootstrap/scss/maps";

Some automated process may throw an error, because it's a minor update and it should be backwards compatible.

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Chrome

What version of Bootstrap are you using?

5.3.0

@glitchwizard
Copy link

Here to back this up as a breaking change

@neonexus
Copy link

neonexus commented Nov 4, 2023

^

@tgm-git
Copy link

tgm-git commented Nov 6, 2023

I have encountered this issue as well, however there are several other issues when upgrading from 5.2.X to 5.3.X. The change should have been marked major, not minor.

@javatlacati
Copy link

did you tried adding the following??

@import "../node_modules/bootstrap/scss/variables-dark";

@Michael-Ziluck
Copy link
Author

did you tried adding the following??

@import "../node_modules/bootstrap/scss/variables-dark";

While that exact solution did not work for me, there are other solutions. However, there are two issues here:

  1. If we are not using dark mode, we should not be required to import dark mode to access Bootstrap's other variables
  2. This was introduced on a minor version change which is breaking and violates semver

@julien-deramond
Copy link
Member

Suggested a patch tackling this issue via #39380. Please test it in your projects to double-check that it fixes well the issue on your side and that it doesn't cause any unexpected side effects 🙏

@neonexus
Copy link

neonexus commented Nov 8, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

6 participants