1.2 #Components - Cards Cards
Cards are the basic content blocks in HolaKit. You will be using it in most cases you need to host some content.
components/card/index.css
, line 1
1.2.1 #Components - Cards - Basic Basic Card
Card components are blocks by default. We don't suggest using them as inlines or inline-blocks. Normally you would just wrap cards in card stack or get them in layouts so they won't get too wide. In some cases you want to wrap cards directly in containers: Fine, but don't do it every where, since cards can be too wide for desktop users. In the following example page, we explictly get a max width for demostration purpose.
Cards can't be too narrow too; Because we have great padding around cards, if you get 4 or more columns in a container, the whole page may looks too messy, and lines in each column will be too short for a comfortable reading experience.
Of course titles are accepted in cards and you will use them frequently. We also get head images for cards, and even pure image cards. Go ahead and make your app vivid.
We have patched cards for being used in links; Feel free to use them as clickable items, but don't use them as buttons. For example, you can use linked cards as article items in a list page of blog, but don't use a card titled "Click Here" as an action button. Card always contains some actual data, instead of pure commands / verbs.
Basic Card Component
俱往矣,数风流人物,还看今朝。
Titled Card
Of course, cards can have a proper title.
Card with image
Card can comes with images. Make sure you have proper class set.
Markup: components/card/card.html
<div class="hola-card-stack" style="max-width: 300px">
<div class="hola-card">
<p>Basic Card Component</p>
<p>俱往矣,数风流人物,还看今朝。</p>
</div>
<div class="hola-card">
<h2 class="hola-card-title">Titled Card</h2>
<p>Of course, cards can have a proper title.</p>
</div>
<div class="hola-card hola-card-with-image">
<img src="https://source.unsplash.com/featured/?head" alt="Photo from Unsplash" class="hola-image">
<h2 class="hola-card-title">Card with image</h2>
<p>Card can comes with images. Make sure you have proper class set.</p>
</div>
<div class="hola-card hola-card-full-image">
<img src="https://source.unsplash.com/featured/?sky" alt="Photo from Unsplash" class="hola-image">
</div>
</div>
components/card/card.css
, line 1
1.2.2 #Components - Cards - Stacks Card Stack
You have seen this in the basic section. But card stacks are more than a container of cards.
We have card stack titles to name the whole stack of cards, and they can be in both light and dark versions. In most cases you use dark versions, but in case you're using our hero component, you may need to set the first stack title to light version to match the dark blue extended hero background. Things can be much different when you're using a picture for heros, or a custom primary color. Try both color version to decide which suits best.
Card stacks can be used in combination with columns, and we automatically handle
card margins to have correct shadow rendering - browsers wraps not only content
but also any display effect applied to content in columns. Be aware, currently we
only support using card stack columns directly under hola-container
.
Stack Title Light
Stack Title
Markup: components/card/stack.html
<div style="background: #3498db; padding: 2rem;">
<h3 class="hola-card-stack-title hola-card-stack-title-light">Stack Title Light</h3>
</div>
<h3 class="hola-card-stack-title">Stack Title</h3>
<div class="hola-card-stack" style="max-width: 300px">
<div class="hola-card">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laborum, sequi.</div>
<div class="hola-card">Praesentium odio, voluptate nihil dolore repellat, aperiam quae adipisci numquam.</div>
<div class="hola-card">Saepe sequi iste neque, voluptatum quidem ducimus placeat obcaecati eum.</div>
</div>
components/card/stack.css
, line 1
1.3 #Components - Info Sheet Info Sheet
Info Sheet is simply designed for displaying key-value-paired data. It's only for plain text data and you should never try to embed any other compoents in it, except badges. It's great for showing something like a ticket or pass. Also make sure that your key should be concise; Longer key may result in a ugly multiline label.
laosb
+1 (555) 555 5555
并不住在美国,但是用着一个美国手机号。他是 Holakit 的最初作者及维护者,常常诈尸。
Markup: components/infosheet.html
<div class="hola-infosheet">
<div class="hola-infosheet-row">
<span class="hola-infosheet-key">用户名</span>
<p class="hola-infosheet-value">laosb</p>
</div>
<div class="hola-infosheet-row">
<span class="hola-infosheet-key">手机号码</span>
<p class="hola-infosheet-value">+1 (555) 555 5555</p>
</div>
<div class="hola-infosheet-row">
<span class="hola-infosheet-key">备注</span>
<p class="hola-infosheet-value">并不住在美国,但是用着一个美国手机号。他是 Holakit 的最初作者及维护者,常常诈尸。</p>
</div>
</div>
components/infosheet.css
, line 1