When creating a modal in twitter bootstrap, is there any way to change the background color? Remove the shading entirely?
NB: For removing shading, this doesn’t work, because it also changes the click behavior. (I still want to be able to click outside the modal to close it.)
$("#myModal").modal({
backdrop: false
});
To change the color via:
CSS
Put these styles in your stylesheet after the bootstrap styles:
Less
Changes the bootstrap-variables to:
Source
Sass
Changes the bootstrap-variables to:
Source
Bootstrap-Customizer
Change
@modal-backdrop-bgto your desired color:getbootstrap.com/customize/
You can also remove the backdrop via Javascript or by setting the color to
transparent.