// // Panels // -------------------------------------------------- // Base class .panel { margin-bottom: $line-height-computed; background-color: $panel-bg; border-radius: $panel-border-radius; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); } // Panel contents .panel-body { padding: $panel-body-padding; @include clearfix; } // Optional heading .panel-heading { padding: $panel-heading-padding; border-bottom: 1px solid transparent; @include border-top-radius($border-radius-base); > .dropdown .dropdown-toggle { color: inherit; } } // Within heading, strip any `h*` tag of its default margins for spacing. .panel-title { margin-top: 0; margin-bottom: 0; font-size: 14px; color: $darkgray-dark; font-weight: normal; > a, > small, > .small, > small > a, > .small > a { color: inherit; } } // Optional footer (stays gray in every modifier class) .panel-footer { padding: $panel-footer-padding; background-color: $lightgray-dark; //$panel-footer-bg; border-top: 1px solid $lightgray-dark; //$panel-inner-border; @include border-bottom-radius($border-radius-base); } // List groups in panels // // By default, space out list group content from panel headings to account for // any kind of custom content between the two. .panel { > .list-group, > .panel-collapse > .list-group { margin-bottom: 0; .list-group-item { border-width: 1px 0; border-radius: 0; } // Add border top radius for first one &:first-child { .list-group-item:first-child { border-top: 0; @include border-top-radius($border-radius-base); } } // Add border bottom radius for last one &:last-child { .list-group-item:last-child { border-bottom: 0; @include border-bottom-radius($border-radius-base); } } } > .panel-heading + .panel-collapse > .list-group { .list-group-item:first-child { @include border-top-radius(0); } } .list-group { box-shadow: none; } .list-group-item:first-child { border-top: 1px solid $lightgray-dark; } } // Collapse space between when there's no additional content. .panel-heading + .list-group { .list-group-item:first-child { border-top-width: 0; } } .list-group + .panel-footer { border-top-width: 0; } // Tables in panels // // Place a non-bordered `.table` within a panel (not within a `.panel-body`) and // watch it go full width. .panel { > .table, > .panel-collapse > .table { margin-bottom: 0; caption { padding-left: $panel-body-padding; padding-right: $panel-body-padding; } } // Add border top radius for first one > .table:first-child { @include border-top-radius($border-radius-base); > thead:first-child, > tbody:first-child { > tr:first-child { border-top-left-radius: $border-radius-base; border-top-right-radius: $border-radius-base; td:first-child, th:first-child { border-top-left-radius: $border-radius-base; } td:last-child, th:last-child { border-top-right-radius: $border-radius-base; } } } } // Add border bottom radius for last one > .table:last-child { @include border-bottom-radius($border-radius-base); > tbody:last-child, > tfoot:last-child { > tr:last-child { border-bottom-left-radius: $border-radius-base; border-bottom-right-radius: $border-radius-base; td:first-child, th:first-child { border-bottom-left-radius: $border-radius-base; } td:last-child, th:last-child { border-bottom-right-radius: $border-radius-base; } } } } > .panel-body + .table, > .table + .panel-body { border-top: 1px solid $table-border-color; } > .table > tbody:first-child > tr:first-child th, > .table > tbody:first-child > tr:first-child td { border-top: 0; } } // Collapsable panels (aka, accordion) // // Wrap a series of panels in `.panel-group` to turn them into an accordion with // the help of our collapse JavaScript plugin. .panel-group { margin-bottom: $line-height-computed; // Tighten up margin so it's only between panels .panel { margin-bottom: 0; border-radius: 0; //$panel-border-radius; background-color: transparent; box-shadow: none; + .panel { margin-top: 0; } } .panel-heading { border-bottom: 0; padding: 0; border-bottom-color: transparent; + .panel-collapse > .panel-body, + .panel-collapse > .list-group { border-top: 1px solid $panel-inner-border; } + .panel-collapse .panel-body { padding: 15px 0; border-top-color: transparent; } } .panel-title a { padding: 10px 0; display: block; } .panel-footer { border-top: 0; + .panel-collapse .panel-body { border-bottom: 1px solid $panel-inner-border; } } } // Contextual variations .panel-default { @include panel-variant($panel-default-border, $panel-default-text, $panel-default-heading-bg, $panel-default-border); border-color: $lightgray-dark; > .panel-heading { color: $darkgray-dark; background-color: $lightgray-dark; border-color: $lightgray-dark; } } .panel-primary { @include panel-variant($panel-primary-border, $panel-primary-text, $panel-primary-heading-bg, $panel-primary-border); border-color: $primary; > .panel-heading { color: $primary; background-color: $primary; border-color: $primary; } } .panel-success { @include panel-variant($panel-success-border, $panel-success-text, $panel-success-heading-bg, $panel-success-border); border-color: $success; > .panel-heading { color: $white; background-color: $success; border-color: $success; } } .panel-info { @include panel-variant($panel-info-border, $panel-info-text, $panel-info-heading-bg, $panel-info-border); border-color: $info; > .panel-heading { color: $white; background-color: $info; border-color: $info; } } .panel-warning { @include panel-variant($panel-warning-border, $panel-warning-text, $panel-warning-heading-bg, $panel-warning-border); border-color: $warning; > .panel-heading { color: $white; background-color: $warning; border-color: $warning; } } .panel-danger { @include panel-variant($panel-danger-border, $panel-danger-text, $panel-danger-heading-bg, $panel-danger-border); border-color: $danger; > .panel-heading { color: $white; background-color: $danger; border-color: $danger; } } .panel-group-lists { .panel { border-bottom: 1px solid $lightgray-dark; background-color: $white; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); } .panel:first-child { border-radius: $border-radius-base $border-radius-base 0 0; } .panel:last-child { border-radius: 0 0 $border-radius-base $border-radius-base; border-bottom: none; } .panel-heading + .panel-collapse .panel-body { padding: 15px; border-top-color: $lightgray-dark; } .panel-title a { padding: 10px 15px; color: $darkgray-dark; } .panel-title a:hover, .panel-title a:focus, .panel-title a:active { color: $mediumgray-dark; } } .panel-primary > .panel-heading > .panel-title, .panel-success > .panel-heading > .panel-title, .panel-info > .panel-heading > .panel-title, .panel-warning > .panel-heading > .panel-title, .panel-danger > .panel-heading > .panel-title { color: $white; } .panel > .panel-body + .table { border-top-color: $lightgray-dark; }