Problem/Motivation
When unchecking modal option 'Insert horizontal line' for either modal header or footer, the modal-no-border class is applied to the respective container that removes the border.
This works well when modal_page module's css is attached after bootstrap css, however, in our use case, we are using a theme that is building the bootstrap css and attaches that stylesheet after modal_page's css (loading Bootstrap via cdn is disabled, as the theme provides Bootstrap assets).
This could be fixed if the border: none !important rule would be used, so that the border is removed regardless when the css is attached.
Steps to reproduce
As written above, to reproduce, you need a Bootstrap based theme that loads the assets after the module's css is loaded. In that case Bootstrap's rule that defines the border on the header/footer will take precedence over modal_page's rule.
I'm not 100% sure if this qualifies as a bug, but IMO the styling should make sure in this case to always remove the border. Feel free to change the issue to improvement if you don't agree.
Proposed resolution
The ideal would be to use Bootstrap's border utility class border-0 here, but unfortunately that is not available in Bootstrap 3.
So in order to keep supporting Bootstrap 3, we could add !important to the custom class.
Remaining tasks
Add !important to the border removing rule for class .modal-no-border.
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | AfterMR.png | 14.35 KB | anirudhsingh19 |
| #5 | BeforeMR.png | 14.31 KB | anirudhsingh19 |
Issue fork modal_page-3547977
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
keszthelyi commentedComment #4
anirudhsingh19 commentedreviewing it!
Comment #5
anirudhsingh19 commentedEven after unchecking 'Insert horizontal line', the line still appears in bootstrap based theme. The MR gets applied cleanly on my D10 site, with Bootstrap5 as my theme. After applying the MR, the issue gets fixed. Attaching screenshots for reference.
Moving to RTBC.
Comment #6
renatog commentedComment #10
renatog commentedMerged into the dev branches
Thank you so much for your help @keszthelyi
Comment #12
renatog commentedReleases created with public thanks for @keszthelyi