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

CommentFileSizeAuthor
#5 AfterMR.png14.35 KBanirudhsingh19
#5 BeforeMR.png14.31 KBanirudhsingh19

Issue fork modal_page-3547977

Command icon 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

keszthelyi created an issue. See original summary.

keszthelyi’s picture

Assigned: keszthelyi » Unassigned
Status: Active » Needs review
anirudhsingh19’s picture

reviewing it!

anirudhsingh19’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new14.31 KB
new14.35 KB

Even 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.

renatog’s picture

  • b935ed8d committed on 5.0.x
    [#3547977] feat: Modal header/footer no border is not always applied
    
    By...

  • 2fd440d8 committed on 5.1.x
    [#3547977] feat: Modal header/footer no border is not always applied
    
    By...

  • a0783914 committed on 6.0.x
    [#3547977] feat: Modal header/footer no border is not always applied
    
    By...
renatog’s picture

Status: Reviewed & tested by the community » Fixed

Merged into the dev branches

Thank you so much for your help @keszthelyi

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.