modals.less 1.63 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
/* ------------------------------------------------------------------------------
*
*  # Modals component
*
*  Overrides for modals bootstrap component
*
*  Version: 1.0
*  Latest update: May 25, 2015
*
* ---------------------------------------------------------------------------- */


// Basic structure
// -------------------------

// Actual modal
.modal-content {
    border-radius: @border-radius-base;
    .box-shadow(0 1px 4px rgba(0,0,0,.2));
}

// Modal header
.modal-header {
    position: relative;
    padding-bottom: 0;

    // With custom color
    &[class*=bg-] {
        padding: @panel-heading-padding;
        .border-top-radius(@border-radius-base - 1);

        .close {
            margin-top: -((@font-size-base * 1.5) / 2);
        }
    }
}

// Close button
.modal-header {
    .modal-content[class*=bg-] & .close,
    &[class*=bg-] .close {
        color: #fff;
    }

    .close {
        position: absolute;
        right: @modal-inner-padding;
        top: 50%;
        margin-top: 0;
    }
}

// Modal body
.modal-body {

    // Close button inside modal body
    .close {
        margin-top: 0!important;
    }
}

// Footer (for actions)
.modal-footer {
    padding-top: 0;

    // Fix for text alignment
    &.text-center {
        text-align: center;
    }
    &.text-left {
        text-align: left;
    }
}


// Setup for mobile
// -------------------------

// Scale up the modal
@media (min-width: @screen-sm-min) {

    // Modal sizes
    .modal-xs {
        width: @modal-xs;
    }
    .modal-full {
        width: @modal-full;
        margin-left: (100% - @modal-full) / 2;
        margin-right: (100% - @modal-full) / 2;
    }
}