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
Modal component: bs-modal css variables not defined #2353
Comments
Hey @jmestxr, thank you for opening this issue! Great observation and I can indeed reproduce this. Before we proceed with the fix suggested in #2354, may I know if you have found the reason why it works in default but not in other themes?
I took a brief look and observe that bootswatch themes uses "Bootstrap v5.2.3" while markbind by default ships "Bootstrap v5.1.3". Is that the underlying reason?
Please feel free to investigate further and let me know if you have any insights on this! |
It seems they are missing because those variables are defined locally within the
Yeah. It seems ur right! For default theme, we are using bootstrap.min.css that is using v5.1.3, which does not use any --bs-modal variables: Whereas for the bootstrap.min.css that is using v5.2.3, they are being used: The other bootswatch themes are using Bootstrap v5.2.3 for their bootstrap.min.css, where --bs-modal variables are used.
This wouldn't seem to be the solution because the problem lies that we didn't specify However to ensure that the same styling behavior for default and other themes, I agree we should sync bootswatch and bootstrap versions.
Yeah, because bootstrap.min.css for default theme is using --bs-modal variables within
Yeah, perhaps we can instead downgrade all bootswatch versions to 5.1.3. which can be downloaded here, to be on sync with the current Bootstrap version. But if we were to upgrade to Bootstrap 5.2.3 in future, we will need to specify |
Have you tried downgrading bootswatch to 5.1.3 (or any higher version that ships with the same bootstrap version?...I'm not sure how they version their package) and see if the modals work for all themes?
In that case, it seems like we should assess whether migrating to Bootstrap 5.2.3 is feasible, which is a separate, larger issue to explore (feel free to tackle this if you are interested:) Specifically for this issue though, were you able to find out from Bootstrap's end why did they make such a change for the modal CSS and any guidance from them on how to best migrate it? |
I tried downgraded to bootswatch 5.1.3 and the modals are working!
Seems like bootstrap made the change to include component variables (not just for modals) for easier theming: https://blog.getbootstrap.com/2022/07/19/bootstrap-5-2-0/ |
Yes, that's great, we should downgrade first before making a further move. Bootstrap touches a lot of things in MarkBind and having an unpinned version is pretty problematic.
Thank you. Pretty interesting. More details available here in the CSS variables page: https://getbootstrap.com/docs/5.2/customize/css-variables/#component-variables In our case, the root cause seems to be due to how we use just the styling of bootstrap modal classes when we implemented the new modal functionality via the vue-final-modal package, i.e. we didn't rely on Bootstrap for hiding/showing the modals. Hence, even though the actual usage from Bootstrap's docs require us to have the
When it got to Bootstrap v5.2, the lack of Here's my suggestion for the solution:
|
Please confirm that you have searched existing issues in the repo
Yes, I have searched the existing issues
Any related issues?
No response
Tell us about your environment
MacOS Ventura
MarkBind version
5.0.1
Describe the bug and the steps to reproduce it
Bug description:
To reproduce the bug, set the bootswatch theme to any theme other than default and use a
modal
component.When using a (non-default) bootswatch theme, bs-modal css variables for modal component are not found, resulting in it not being styled properly:
bootswatch theme used: 'sketchy'
Upon further probing, I found out this was due to
bs-modal
css variables not being registered:These variables are defined in bootstrap's
modal
class, which were not specified in the Modal vue component:modal
class not specified in Modal componentFix:
modal
class in vue componentmodal
class contains adisplay: none
. To override this, I added adisplay: block
to modal-dialog class to fix this so the modal can be seen.Additional notes:
bootstrap.min.css
file for default themeExpected behavior
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: