mirror of
				https://github.com/twbs/bootstrap.git
				synced 2025-11-04 00:03:15 -05:00 
			
		
		
		
	* remove the $enable-flex variable option * remove bootstrap-flex.css dist file and it's grunt task * remove the separate flex css file for docs; it's all the same now * remove flexbox docs (porting some to the main grid docs in next commit) * clean up few grid docs bits to simplify copy, start to mention flexbox * port relevant flexbox-grid.md content to grid.md - clean up mixins - update how it works section - bring over sizing and alignment sections * remove the $enable-flex from the options.md page * update lead paragraph to mention flexbox * update migration to mention loss of ie9 support * remove mention of flexbox dist file * clarify IE support * making a note * remove flexbox variant mentions from component docs - updates docs for media object, navs, list group, and cards to consolidate docs - no more need to callout flexbox variants since it's now the default * remove $enable-flex if/else from sass files * remove flex dist files * update scss lint property order to account for flex properties * linting * change to numberless classes for autosizing, wrap in highlighting div * bump gruntfile and postcss to ie10 * redo intro sections * rearrange * phew, redo hella grid docs - rearrange all the things - consolidate some bits * remove reference to flexbox mode * more border action for demo * Make some changes to the .card's in .card-deck's to ensure footers align to the bottom
		
			
				
	
	
		
			292 lines
		
	
	
		
			5.4 KiB
		
	
	
	
		
			SCSS
		
	
	
	
	
	
			
		
		
	
	
			292 lines
		
	
	
		
			5.4 KiB
		
	
	
	
		
			SCSS
		
	
	
	
	
	
//
 | 
						|
// Base styles
 | 
						|
//
 | 
						|
 | 
						|
.card {
 | 
						|
  position: relative;
 | 
						|
  display: block;
 | 
						|
  margin-bottom: $card-spacer-y;
 | 
						|
  background-color: $card-bg;
 | 
						|
  border: $card-border-width solid $card-border-color;
 | 
						|
  @include border-radius($card-border-radius);
 | 
						|
}
 | 
						|
 | 
						|
.card-block {
 | 
						|
  padding: $card-spacer-x;
 | 
						|
}
 | 
						|
 | 
						|
.card-title {
 | 
						|
  margin-bottom: $card-spacer-y;
 | 
						|
}
 | 
						|
 | 
						|
.card-subtitle {
 | 
						|
  margin-top: -($card-spacer-y / 2);
 | 
						|
  margin-bottom: 0;
 | 
						|
}
 | 
						|
 | 
						|
.card-text:last-child {
 | 
						|
  margin-bottom: 0;
 | 
						|
}
 | 
						|
 | 
						|
// .card-actions {
 | 
						|
//   padding: $card-spacer-y $card-spacer-x;
 | 
						|
 | 
						|
//   .card-link + .card-link {
 | 
						|
//     margin-left: $card-spacer-x;
 | 
						|
//   }
 | 
						|
// }
 | 
						|
 | 
						|
.card-link {
 | 
						|
  @include hover {
 | 
						|
    text-decoration: none;
 | 
						|
  }
 | 
						|
 | 
						|
  + .card-link {
 | 
						|
    margin-left: $card-spacer-x;
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
.card {
 | 
						|
  > .list-group:first-child {
 | 
						|
    .list-group-item:first-child {
 | 
						|
      @include border-top-radius($card-border-radius);
 | 
						|
    }
 | 
						|
  }
 | 
						|
 | 
						|
  > .list-group:last-child {
 | 
						|
    .list-group-item:last-child {
 | 
						|
      @include border-bottom-radius($card-border-radius);
 | 
						|
    }
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
 | 
						|
//
 | 
						|
// Optional textual caps
 | 
						|
//
 | 
						|
 | 
						|
.card-header {
 | 
						|
  padding: $card-spacer-y $card-spacer-x;
 | 
						|
  margin-bottom: 0; // Removes the default margin-bottom of <hN>
 | 
						|
  background-color: $card-cap-bg;
 | 
						|
  border-bottom: $card-border-width solid $card-border-color;
 | 
						|
 | 
						|
  &:first-child {
 | 
						|
    @include border-radius($card-border-radius-inner $card-border-radius-inner 0 0);
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
.card-footer {
 | 
						|
  padding: $card-spacer-y $card-spacer-x;
 | 
						|
  background-color: $card-cap-bg;
 | 
						|
  border-top: $card-border-width solid $card-border-color;
 | 
						|
 | 
						|
  &:last-child {
 | 
						|
    @include border-radius(0 0 $card-border-radius-inner $card-border-radius-inner);
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
 | 
						|
//
 | 
						|
// Header navs
 | 
						|
//
 | 
						|
 | 
						|
.card-header-tabs {
 | 
						|
  margin-right: -($card-spacer-x / 2);
 | 
						|
  margin-bottom: -$card-spacer-y;
 | 
						|
  margin-left: -($card-spacer-x / 2);
 | 
						|
  border-bottom: 0;
 | 
						|
}
 | 
						|
 | 
						|
.card-header-pills {
 | 
						|
  margin-right: -($card-spacer-x / 2);
 | 
						|
  margin-left: -($card-spacer-x / 2);
 | 
						|
}
 | 
						|
 | 
						|
 | 
						|
//
 | 
						|
// Background variations
 | 
						|
//
 | 
						|
 | 
						|
.card-primary {
 | 
						|
  @include card-variant($brand-primary, $brand-primary);
 | 
						|
}
 | 
						|
.card-success {
 | 
						|
  @include card-variant($brand-success, $brand-success);
 | 
						|
}
 | 
						|
.card-info {
 | 
						|
  @include card-variant($brand-info, $brand-info);
 | 
						|
}
 | 
						|
.card-warning {
 | 
						|
  @include card-variant($brand-warning, $brand-warning);
 | 
						|
}
 | 
						|
.card-danger {
 | 
						|
  @include card-variant($brand-danger, $brand-danger);
 | 
						|
}
 | 
						|
 | 
						|
// Remove all backgrounds
 | 
						|
.card-outline-primary {
 | 
						|
  @include card-outline-variant($btn-primary-bg);
 | 
						|
}
 | 
						|
.card-outline-secondary {
 | 
						|
  @include card-outline-variant($btn-secondary-border);
 | 
						|
}
 | 
						|
.card-outline-info {
 | 
						|
  @include card-outline-variant($btn-info-bg);
 | 
						|
}
 | 
						|
.card-outline-success {
 | 
						|
  @include card-outline-variant($btn-success-bg);
 | 
						|
}
 | 
						|
.card-outline-warning {
 | 
						|
  @include card-outline-variant($btn-warning-bg);
 | 
						|
}
 | 
						|
.card-outline-danger {
 | 
						|
  @include card-outline-variant($btn-danger-bg);
 | 
						|
}
 | 
						|
 | 
						|
//
 | 
						|
// Inverse text within a card for use with dark backgrounds
 | 
						|
//
 | 
						|
 | 
						|
.card-inverse {
 | 
						|
  @include card-inverse;
 | 
						|
}
 | 
						|
 | 
						|
//
 | 
						|
// Blockquote
 | 
						|
//
 | 
						|
 | 
						|
.card-blockquote {
 | 
						|
  padding: 0;
 | 
						|
  margin-bottom: 0;
 | 
						|
  border-left: 0;
 | 
						|
}
 | 
						|
 | 
						|
// Card image
 | 
						|
.card-img {
 | 
						|
  // margin: -1.325rem;
 | 
						|
  @include border-radius($card-border-radius-inner);
 | 
						|
}
 | 
						|
.card-img-overlay {
 | 
						|
  position: absolute;
 | 
						|
  top: 0;
 | 
						|
  right: 0;
 | 
						|
  bottom: 0;
 | 
						|
  left: 0;
 | 
						|
  padding: $card-img-overlay-padding;
 | 
						|
}
 | 
						|
 | 
						|
 | 
						|
 | 
						|
// Card image caps
 | 
						|
.card-img-top {
 | 
						|
  @include border-top-radius($card-border-radius-inner);
 | 
						|
}
 | 
						|
.card-img-bottom {
 | 
						|
  @include border-bottom-radius($card-border-radius-inner);
 | 
						|
}
 | 
						|
 | 
						|
 | 
						|
// Card set
 | 
						|
//
 | 
						|
// Heads up! We do some funky style resetting here for margins across our two
 | 
						|
// variations (one flex, one table). Individual cards have margin-bottom by
 | 
						|
// default, but they're ignored due to table styles. For a consistent design,
 | 
						|
// we've done the same to the flex variation.
 | 
						|
//
 | 
						|
// Those changes are noted by `// Margin balancing`.
 | 
						|
 | 
						|
@include media-breakpoint-up(sm) {
 | 
						|
  .card-deck {
 | 
						|
    display: flex;
 | 
						|
    flex-flow: row wrap;
 | 
						|
    margin-right: -$card-deck-margin;
 | 
						|
    margin-bottom: $card-spacer-y; // Margin balancing
 | 
						|
    margin-left: -$card-deck-margin;
 | 
						|
 | 
						|
    .card {
 | 
						|
      display: flex;
 | 
						|
      flex: 1 0 0;
 | 
						|
      flex-direction: column;
 | 
						|
      margin-right: $card-deck-margin;
 | 
						|
      margin-bottom: 0; // Margin balancing
 | 
						|
      margin-left: $card-deck-margin;
 | 
						|
    }
 | 
						|
 | 
						|
    .card-block {
 | 
						|
      flex-grow: 1;
 | 
						|
    }
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
 | 
						|
//
 | 
						|
// Card groups
 | 
						|
//
 | 
						|
 | 
						|
@include media-breakpoint-up(sm) {
 | 
						|
  .card-group {
 | 
						|
    display: flex;
 | 
						|
    flex-flow: row wrap;
 | 
						|
 | 
						|
    .card {
 | 
						|
      flex: 1 0 0;
 | 
						|
 | 
						|
      + .card {
 | 
						|
        margin-left: 0;
 | 
						|
        border-left: 0;
 | 
						|
      }
 | 
						|
 | 
						|
      // Handle rounded corners
 | 
						|
      @if $enable-rounded {
 | 
						|
        &:first-child {
 | 
						|
          @include border-right-radius(0);
 | 
						|
 | 
						|
          .card-img-top {
 | 
						|
            border-top-right-radius: 0;
 | 
						|
          }
 | 
						|
          .card-img-bottom {
 | 
						|
            border-bottom-right-radius: 0;
 | 
						|
          }
 | 
						|
        }
 | 
						|
        &:last-child {
 | 
						|
          @include border-left-radius(0);
 | 
						|
 | 
						|
          .card-img-top {
 | 
						|
            border-top-left-radius: 0;
 | 
						|
          }
 | 
						|
          .card-img-bottom {
 | 
						|
            border-bottom-left-radius: 0;
 | 
						|
          }
 | 
						|
        }
 | 
						|
 | 
						|
        &:not(:first-child):not(:last-child) {
 | 
						|
          border-radius: 0;
 | 
						|
 | 
						|
          .card-img-top,
 | 
						|
          .card-img-bottom {
 | 
						|
            border-radius: 0;
 | 
						|
          }
 | 
						|
        }
 | 
						|
      }
 | 
						|
    }
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
 | 
						|
//
 | 
						|
// Card
 | 
						|
//
 | 
						|
 | 
						|
@include media-breakpoint-up(sm) {
 | 
						|
  .card-columns {
 | 
						|
    column-count: 3;
 | 
						|
    column-gap: $card-columns-sm-up-column-gap;
 | 
						|
 | 
						|
    .card {
 | 
						|
      display: inline-block; // Don't let them vertically span multiple columns
 | 
						|
      width: 100%; // Don't let them exceed the column width
 | 
						|
    }
 | 
						|
  }
 | 
						|
}
 |