From 6af449f645ab31fc5b9d2f4c4a062d4400662a6b Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Fri, 30 Jun 2017 14:48:46 -0700 Subject: [PATCH] Update card docs to loop over the theme colors and use bg, border, and color utilities --- docs/4.0/components/card.md | 133 ++++++++---------------------------- 1 file changed, 29 insertions(+), 104 deletions(-) diff --git a/docs/4.0/components/card.md b/docs/4.0/components/card.md index 3497c6d0e4..4c96c8647a 100644 --- a/docs/4.0/components/card.md +++ b/docs/4.0/components/card.md @@ -366,126 +366,51 @@ Turn an image into a card background and overlay your card's text. Depending on Cards include various options for customizing their backgrounds, borders, and color. -### Dark cards +### Background and color -By default, cards use dark text and assume a light background. You can reverse that by toggling the `color` of text within, as well as that of the card's subcomponents, with `.card-dark`. Then, specify a dark `background-color` and `border-color` to go with it. - -You can also use `.card-dark` with the [contextual backgrounds variants](#background-variants). +Use [text and background utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/colors/) to change the appearance of a card. {% example html %} -
+{% for color in site.data.theme-colors %} +
Header
-

Special title treatment

-

With supporting text below as a natural lead-in to additional content.

- Go somewhere +

{{ color.name | capitalize }} card title

+

Some quick example text to build on the card title and make up the bulk of the card's content.

- -
-{% endexample %} - -### Background variants - -Cards include their own variant classes for quickly changing the `background-color` and `border-color` of a card. **Darker colors require the use of `.card-dark`.** - -{% example html %} -
-
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

-
Someone famous in Source Title
-
-
-
-
-
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

-
Someone famous in Source Title
-
-
-
-
-
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

-
Someone famous in Source Title
-
-
-
-
-
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

-
Someone famous in Source Title
-
-
-
-
-
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

-
Someone famous in Source Title
-
-
-
+
{% endfor %} {% endexample %} {% capture callout-include %}{% include callout-warning-color-assistive-technologies.md %}{% endcapture %} {{ callout-include | markdownify }} -### Outline cards +### Border -In need of a colored card, but not the hefty background colors they bring? Replace the default modifier classes with the `.card-outline-*` ones to style just the `border-color` of a card. +Use [border utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/borders/) to change just the `border-color` of a card. Note that you can put `.text-{color}` classes on the parent `.card` or a subset of the card's contents as shown below. {% example html %} -
-
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

-
Someone famous in Source Title
-
+{% for color in site.data.theme-colors %} +
+
Header
+
+

{{ color.name | capitalize }} card title

+

Some quick example text to build on the card title and make up the bulk of the card's content.

-
-
-
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

-
Someone famous in Source Title
-
-
-
-
-
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

-
Someone famous in Source Title
-
-
-
-
-
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

-
Someone famous in Source Title
-
-
-
-
-
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

-
Someone famous in Source Title
-
-
-
-
-
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

-
Someone famous in Source Title
-
+
{% endfor %} +{% endexample %} + +### Mixins utilities + +You can also change the borders on the card header and footer as needed, and even remove their `background-color` with `.bg-transparent`. + +{% example html %} +
+
Header
+
+

Success card title

+

Some quick example text to build on the card title and make up the bulk of the card's content.

+
{% endexample %}