Commit 74d17ab7 authored by Mark Otto's avatar Mark Otto

rewrite much of cards and the docs

parent e07cebc9
This diff is collapsed.
...@@ -2,63 +2,91 @@ ...@@ -2,63 +2,91 @@
// Base styles // Base styles
// //
$card-spacer-x: 1.25rem;
$card-spacer-y: .75rem;
$card-border-width: .0625rem;
$card-border-radius: .25rem;
.card { .card {
position: relative; position: relative;
padding: 1.25rem; margin-bottom: $card-spacer-y;
margin-bottom: 1.25rem; border: $card-border-width solid #e5e5e5;
border: .075rem solid #eee; @include border-radius($card-border-radius);
}
.card-block {
padding: $card-spacer-x;
} }
.card-title { .card-title {
margin-top: 0; margin-top: 0;
margin-bottom: .75rem; margin-bottom: $card-spacer-y;
} }
.card-text:last-child {
.card-subtitle {
margin-top: -($card-spacer-y / 2);
margin-bottom: 0; margin-bottom: 0;
} }
.card-actions {
.card-link + .card-link { .card-text:last-child {
margin-left: .75rem; margin-bottom: 0;
}
} }
// .card-actions {
// padding: $card-spacer-y $card-spacer-x;
// .card-link + .card-link {
// margin-left: $card-spacer-x;
// }
// }
.card-link { .card-link {
@include hover { @include hover {
text-decoration: none; text-decoration: none;
} }
}
+ .card-link {
margin-left: $card-spacer-x;
}
}
// @if $enable-rounded {
// Optional textual caps .card {
// > .list-group:first-child {
.list-group-item:first-child {
border-radius: $card-border-radius $card-border-radius 0 0;
}
}
.card-header { > .list-group:last-child {
padding: .75rem 1.25rem; .list-group-item:last-child {
margin: -1.25rem -1.25rem 1.25rem; border-radius: 0 0 $card-border-radius $card-border-radius;
border-bottom: .075rem solid #eee; }
@include border-radius(.25rem .25rem 0 0); }
} }
.card-footer {
padding: .75rem 1.25rem;
margin: 1.25rem -1.25rem -1.25rem;
border-top: .075rem solid #eee;
@include border-radius(0 0 .25rem .25rem);
} }
// //
// Sizing variations // Optional textual caps
// //
.card-sm { .card-header {
width: 15rem; padding: $card-spacer-y $card-spacer-x;
} border-bottom: $card-border-width solid #eee;
.card-md { &:first-child {
width: 30rem; @include border-radius($card-border-radius $card-border-radius 0 0);
}
} }
.card-lg { .card-footer {
width: 45rem; padding: $card-spacer-y $card-spacer-x;
border-top: $card-border-width solid #eee;
&:last-child {
@include border-radius(0 0 $card-border-radius $card-border-radius);
}
} }
...@@ -128,7 +156,7 @@ ...@@ -128,7 +156,7 @@
// Card image // Card image
.card-img { .card-img {
margin: -1.325rem; // margin: -1.325rem;
@include border-radius(.25rem); @include border-radius(.25rem);
} }
.card-img-overlay { .card-img-overlay {
...@@ -144,11 +172,9 @@ ...@@ -144,11 +172,9 @@
// Card image caps // Card image caps
.card-img-top { .card-img-top {
margin: -1.325rem -1.325rem 1.25rem;
@include border-radius(.25rem .25rem 0 0); @include border-radius(.25rem .25rem 0 0);
} }
.card-img-bottom { .card-img-bottom {
margin: 1.25rem -1.325rem -1.325rem;
@include border-radius(0 0 .25rem .25rem); @include border-radius(0 0 .25rem .25rem);
} }
...@@ -157,22 +183,36 @@ ...@@ -157,22 +183,36 @@
// Card set // Card set
// //
.card-set { @if $enable-flex {
display: table; .card-deck {
table-layout: fixed; display: flex;
border-spacing: 1.25rem 0; flex-flow: row wrap;
margin-right: -.75rem;
margin-left: -.75rem;
.card { .card {
display: table-cell; flex: 1 0 0;
float: none; margin-left: .75rem;
max-width: none; margin-right: .75rem;
}
} }
} } @else {
.card-set-wrapper { .card-deck {
margin-right: -1.25rem; display: table;
margin-left: -1.25rem; table-layout: fixed;
} border-spacing: 1.25rem 0;
.card {
display: table-cell;
float: none;
max-width: none;
}
}
.card-deck-wrapper {
margin-right: -1.25rem;
margin-left: -1.25rem;
}
}
// //
// Card groups // Card groups
...@@ -199,6 +239,38 @@ ...@@ -199,6 +239,38 @@
margin-left: 0; margin-left: 0;
border-left: 0; border-left: 0;
} }
// Handle rounded corners
&:first-child {
.card-img-top {
@if $enable-rounded {
border-top-right-radius: 0;
}
}
.card-img-bottom {
@if $enable-rounded {
border-bottom-right-radius: 0;
}
}
}
&:last-child {
.card-img-top {
@if $enable-rounded {
border-top-left-radius: 0;
}
}
.card-img-bottom {
@if $enable-rounded {
border-bottom-left-radius: 0;
}
}
}
&:not(:first-child):not(:last-child) {
.card-img-top,
.card-img-bottom {
@include border-radius(0);
}
}
} }
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
.list-group { .list-group {
// No need to set list-style: none; since .list-group-item is block level // No need to set list-style: none; since .list-group-item is block level
padding-left: 0; // reset padding because ul and ol padding-left: 0; // reset padding because ul and ol
margin-bottom: 20px; margin-bottom: 0;
} }
...@@ -21,11 +21,11 @@ ...@@ -21,11 +21,11 @@
.list-group-item { .list-group-item {
position: relative; position: relative;
display: block; display: block;
padding: 10px 15px; padding: .75rem 1.25rem;
// Place the border on the list items and negative margin up for better styling // Place the border on the list items and negative margin up for better styling
margin-bottom: -1px; margin-bottom: -.0625rem;
background-color: $list-group-bg; background-color: $list-group-bg;
border: 1px solid $list-group-border; border: .0625rem solid $list-group-border;
// Round the first and last items // Round the first and last items
&:first-child { &:first-child {
...@@ -37,6 +37,13 @@ ...@@ -37,6 +37,13 @@
} }
} }
.list-group-flush {
.list-group-item {
border-width: .0625rem 0;
border-radius: 0;
}
}
// Linked list items // Linked list items
// //
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment