提交 0cd61a8c 编写于 作者: C codecalm

cards, buttons

上级 56432a51
...@@ -42,7 +42,7 @@ jekyll_tidy: ...@@ -42,7 +42,7 @@ jekyll_tidy:
toc: toc:
min_level: 2 min_level: 2
max_level: 2 max_level: 3
list_class: list-unstyled list_class: list-unstyled
collections: collections:
......
...@@ -4,6 +4,7 @@ icon: fe fe-plus-square ...@@ -4,6 +4,7 @@ icon: fe fe-plus-square
description: Use Bootstrap’s custom button styles for actions in forms, dialogs, and more. Includes support for a handful of contextual variations, sizes, states, and more. description: Use Bootstrap’s custom button styles for actions in forms, dialogs, and more. Includes support for a handful of contextual variations, sizes, states, and more.
bootstrap-link: components/buttons/ bootstrap-link: components/buttons/
done: true done: true
toc: true
--- ---
### Button tag ### Button tag
...@@ -263,7 +264,7 @@ You can now create a list of buttons with the `.btn-list` container. ...@@ -263,7 +264,7 @@ You can now create a list of buttons with the `.btn-list` container.
<a href="#" class="btn btn-danger">Cancel</a> <a href="#" class="btn btn-danger">Cancel</a>
</div> </div>
{% endcapture %} {% endcapture %}
{% include example.html code=code centered=true %} {% include example.html code=code %}
If the list is very long, it will automatically wrap on multiple lines, while keeping all buttons evenly spaced. If the list is very long, it will automatically wrap on multiple lines, while keeping all buttons evenly spaced.
......
...@@ -4,33 +4,63 @@ menu: docs.cards ...@@ -4,33 +4,63 @@ menu: docs.cards
description: A card is a flexible and extensible content container. It includes options for headers and footers, a wide variety of content, contextual background colors, and powerful display options. description: A card is a flexible and extensible content container. It includes options for headers and footers, a wide variety of content, contextual background colors, and powerful display options.
bootstrap-link: components/card/ bootstrap-link: components/card/
done: true done: true
toc: true
--- ---
The `.card` element is simply a container with a shadow, a border, a radius, and some padding. Built with flexbox, they offer easy alignment and mix well with other Bootstrap components. The `.card` element is simply a container with a shadow, a border, a radius, and some padding. Built with flexbox, they offer easy alignment and mix well with other Bootstrap components.
### Default card ## Default card
To create a new card you have to use the `.card` and `.card-body` classes. You can put any content inside.
{% capture code %} {% capture code %}
{% include cards/card.html body="This is some text within a card body." %} {% include cards/card.html body="This is some text within a card body." %}
{% endcapture %} {% endcapture %}
{% include example.html code=code %} {% include example.html code=code columns=1 %}
### Card padding
You can change the padding of a newly created card. You can do this with the `.card-sm`, `.card-md` and `.card-lg` classes.
Cards with the `.card-sm` class are very well suited for small items such as snippets, etc., while `.card-lg` can be used for large blocks of text. On small devices, padding will automatically be reduced to fit on the screen.
{% capture code %}
{% include cards/card.html class="card-sm" body="This is some text within a card body." %}
{% include cards/card.html body="This is some text within a card body." %}
{% include cards/card.html class="card-md" body="This is some text within a card body." %}
{% include cards/card.html class="card-lg" body="This is some text within a card body." %}
{% endcapture %}
{% include example.html code=code columns=2 %}
### Card with title and image ## Card with title
To add a title to a card you should add a class `.card-title` inside `.card-body`.
You can also place the title inside the `.card-header` element - then the title will be separated from the content by a horizontal line.
{% capture code %}
{% include cards/card.html title="Card title" body="This is some text within a card body." %}
{% include cards/card.html header-title="Card title" body="This is some text within a card body." %}
{% endcapture %}
{% include example.html code=code columns=1 %}
## Card with title and image
{% capture code %} {% capture code %}
{% include cards/card.html img-top=true title="Card with title and image" %} {% include cards/card.html img-top=true title="Card with title and image" %}
{% endcapture %} {% endcapture %}
{% include example.html code=code %} {% include example.html code=code columns=1 %}
### Blog post card
## Blog post card
The best way to make your post eye-catching is adding an image to it. To do so, just add the image with the `.card-img-top` class. We've added the `.d-flex .flex-column` classes to the `.card-body` to have the author details be on the bottom of the card. The best way to make your post eye-catching is adding an image to it. To do so, just add the image with the `.card-img-top` class. We've added the `.d-flex .flex-column` classes to the `.card-body` to have the author details be on the bottom of the card.
{% capture code %} {% capture code %}
{% include cards/blog-single.html type="image" %} {% include cards/blog-single.html type="image" %}
{% endcapture %} {% endcapture %}
{% include example.html code=code %} {% include example.html code=code columns=1 %}
### Row deck ## Row deck
If you want to create a couple of posts next to each other, add the `.row-deck` class to `.row`—then they will all have the same height. If you want to create a couple of posts next to each other, add the `.row-deck` class to `.row`—then they will all have the same height.
...@@ -55,7 +85,7 @@ If you want to create a couple of posts next to each other, add the `.row-deck` ...@@ -55,7 +85,7 @@ If you want to create a couple of posts next to each other, add the `.row-deck`
{% endcapture %} {% endcapture %}
{% include example.html code=code %} {% include example.html code=code %}
### Post card with aside image ## Post card with aside image
You can also add the image on the left side of the card. All you need do to is: add the `.card-aside` class to the element with the `.card` class. Then add the image in the `.card-aside-column` element. No worries, tabler will automatically center it and scale to right size: You can also add the image on the left side of the card. All you need do to is: add the `.card-aside` class to the element with the `.card` class. Then add the image in the `.card-aside-column` element. No worries, tabler will automatically center it and scale to right size:
...@@ -64,7 +94,7 @@ You can also add the image on the left side of the card. All you need do to is: ...@@ -64,7 +94,7 @@ You can also add the image on the left side of the card. All you need do to is:
{% endcapture %} {% endcapture %}
{% include example.html code=code %} {% include example.html code=code %}
### Color variations ## Color variations
{% capture code %} {% capture code %}
<div class="row row-deck"> <div class="row row-deck">
...@@ -78,7 +108,7 @@ You can also add the image on the left side of the card. All you need do to is: ...@@ -78,7 +108,7 @@ You can also add the image on the left side of the card. All you need do to is:
{% endcapture %} {% endcapture %}
{% include example.html code=code %} {% include example.html code=code %}
### Stacked card ## Stacked card
{% capture code %} {% capture code %}
{% include cards/card.html class="card-stacked" title="Stacked card" %} {% include cards/card.html class="card-stacked" title="Stacked card" %}
......
<div class="example{% if include.centered %} example-centered{% endif %}"> <div class="example no_toc_section{% if include.centered %} example-centered{% endif %}{% if include.columns %} example-bg{% endif %}">
<div class="example-content"> <div class="example-content">
{% if include.wrapper %}<div class="{{ include.wrapper }}">{% endif %} {% if include.wrapper %}<div class="{{ include.wrapper }}">{% endif %}
{% if include.columns %}<div class="example-column example-column-{{ include.columns }}">{% endif %}
{{ code }} {{ code }}
{% if include.columns %}</div>{% endif %}
{% if include.wrapper %}</div>{% endif %} {% if include.wrapper %}</div>{% endif %}
</div> </div>
</div> </div>
......
...@@ -8,9 +8,19 @@ page-header: Documentation ...@@ -8,9 +8,19 @@ page-header: Documentation
{% assign current-url = page.url | replace_regex: "^/", "" %} {% assign current-url = page.url | replace_regex: "^/", "" %}
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-lg-3 order-lg-1 mb-4"> <div class="d-none d-lg-block col-lg-3 order-lg-1 mb-4">
{% include ui/button.html href=site.github_url text="Browse source code" icon="brand/github" icon-color="github" external=true block=true class="mb-4" %}
<div class="sticky-top pt-4">
<h5 class="subheader">On this page</h5>
{{ content | toc_only }}
{% include ui/button.html href=site.github_url text="Browse source code" icon="brand/github" icon-color="github" external=true block=true class="mb-4" %}
</div>
{% comment %}
<div class="list-group list-group-transparent mb-0"> <div class="list-group list-group-transparent mb-0">
{% for doc in site.data.menu.docs.children %} {% for doc in site.data.menu.docs.children %}
{% assign key = doc[0] %} {% assign key = doc[0] %}
...@@ -22,32 +32,30 @@ page-header: Documentation ...@@ -22,32 +32,30 @@ page-header: Documentation
{% endif %} {% endif %}
{{ doc[1].title }} {{ doc[1].title }}
{% if doc[1].badge %}
{% assign badge = doc[1].badge %}
{% include ui/badge.html text=badge color="green" class="ml-auto" %}
{% endif %}
</a> </a>
{% endfor %} {% endfor %}
</div> </div>
{% endcomment %}
</div> </div>
<div class="col-lg-9"> <div class="col-lg-9">
<div class="card"> <div class="card">
<div class="card-body p-md-6 p-xl-7"> <div class="card-body p-md-6 p-xl-7">
<div class="markdown"> <div class="markdown">
{% if page.bootstrap-link %} <div class="d-flex">
<p class="mb-4 float-right"> <h2 class="h1 mt-0 mb-3">{{ page.title }}
<a href="https://getbootstrap.com/docs/4.4/{{ page.bootstrap-link }}" target="_blank"> {% if page.done %} {% include ui/icon.html icon="check" color="green" %}{% endif %}
{% include ui/icon.html icon="external-link" color="blue" class="pr-1" %} </h2>
Bootstrap documentation
</a>
</p>
{% endif %}
<h2 class="h1 mt-0 mb-3">{{ page.title }} {% if page.bootstrap-link %}
{% if page.done %} {% include ui/icon.html icon="check" color="green" %}{% endif %} <p class="ml-auto">
</h2> <a href="https://getbootstrap.com/docs/4.4/{{ page.bootstrap-link }}" target="_blank">
{% include ui/icon.html icon="external-link" color="blue" class="pr-1" %}
Bootstrap documentation
</a>
</p>
{% endif %}
</div>
{% if page.plugin %} {% if page.plugin %}
<div class="alert alert-info">This module is available in <code>tabler-{{ page.plugin }}</code> <div class="alert alert-info">This module is available in <code>tabler-{{ page.plugin }}</code>
...@@ -59,10 +67,6 @@ page-header: Documentation ...@@ -59,10 +67,6 @@ page-header: Documentation
<p>{{ page.description }}</p> <p>{{ page.description }}</p>
{% endif %} {% endif %}
{% if page.toc %}
{{ content | toc_only }}
{% endif %}
{{ content | toc_generate }} {{ content | toc_generate }}
</div> </div>
</div> </div>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册