Typography
Body Copy
This is the default body copy text style in use throughout the Duke University Libraries website. Here is a longer block of paragraph text to demonstrate how lines of text are spaced vertically. This text is encoded in <p>
tags to indicate it is a paragraph. Some additional characteristics:
- Font Family:
- Font Size:
- Color:
- Line Height:
Type Variations
Strong text — <strong>
Italic text — <em>
Smaller text — <small>
Muted text — .text-muted
Highlighted text - <mark>
Bold text — .font-weight-bold
Semibold text — .font-weight-semibold
Blockquotes Docs »
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
Lists Docs »
A plain <ul>
with no class
or id
will display with a stylized bullet. You can add other list classes and still get a stylized bullet by using <ul class="list-styled">
. Most of these are DUL-custom styles.
Unordered
<ul>
- Lorem ipsum dolor sit amet
- Consectetur adipiscing elit
- Integer lorem at massa
- Facilisis in pretium nisl aliquet
- Nulla volutpat aliquam velit
Ordered
<ol>
- Lorem ipsum dolor sit amet
- Consectetur adipiscing elit
- Integer lorem at massa
- Facilisis in pretium nisl aliquet
- Nulla volutpat aliquam velit
Unstyled
<ul class="list-unstyled">
- Lorem ipsum dolor sit amet
- Consectetur adipiscing elit
- Integer lorem at massa
- Facilisis in pretium nisl aliquet
- Nulla volutpat aliquam velit
Outdent
<ul class="outdent list-unstyled">
- Lorem ipsum dolor sit amet. Consectetur adipiscing elit. Integer lorem at massa. Facilisis in pretium nisl aliquet. Nulla volutpat aliquam velit.
- Consectetur adipiscing elit
- Integer lorem at massa
Spacing: None
<ul class="spacing-none list-styled">
- Lorem ipsum dolor sit amet
- Consectetur adipiscing elit
- Integer lorem at massa
- Facilisis in pretium nisl aliquet
- Nulla volutpat aliquam velit
Spacing: Small
<ul class="spacing-sm list-styled">
- Lorem ipsum dolor sit amet
- Consectetur adipiscing elit
- Integer lorem at massa
- Facilisis in pretium nisl aliquet
- Nulla volutpat aliquam velit
Spacing: Md
<ul class="spacing-md list-styled">
- Lorem ipsum dolor sit amet
- Consectetur adipiscing elit
- Integer lorem at massa
- Facilisis in pretium nisl aliquet
- Nulla volutpat aliquam velit
Spacing: Lg
<ul class="spacing-lg list-styled">
- Lorem ipsum dolor sit amet
- Consectetur adipiscing elit
- Integer lorem at massa
- Facilisis in pretium nisl aliquet
- Nulla volutpat aliquam velit
Inline
<ul class="list-inline">
<li class="list-inline-item">...
- Lorem ipsum
- Consectetur
- Integer lorem
- Facilisis
- Nulla volutpat
Inline Styled
<ul class="list-inline list-styled">
<li class="list-inline-item">...
- Lorem ipsum
- Consectetur
- Integer lorem
- Facilisis
- Nulla volutpat
Description List Docs »
<dl>
<dt>...</dt>
<dd>...</dd>
</dl>
- Description lists
- A description list is perfect for defining terms.
- Euismod
- Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.
- Malesuada porta
- Etiam porta sem malesuada magna mollis euismod.
Description List Horizontal Docs »
<dl class="row">
<dt class="col-sm-3">...</dt>
<dd class="col-sm-9">...</dd>
</dl>
- Description lists
- A description list is perfect for defining terms.
- Euismod
- Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.
- Malesuada porta
- Etiam porta sem malesuada magna mollis euismod.
PDF Link List
<ul class="pdflinks list-unstyled">
Buttons Docs »
Button Sizes & Variants Docs »
Icons Docs »
Our DUL Drupal theme uses the FontAwesome 5 Free icon library. Insert an icon using HTML (easiest), or by using CSS pseudo-elements (advanced).
Example HTML:
<i class="fas fa-book-open"> </i>
.
Examples
Note that each has two classes. fas
, far
, & fab
correspond to solid
, regular
, or brand
icons.
fas fa-book-open
fas fa-bookmark text-danger
fas fa-check-circle text-success
fas fa-user-graduate
far fa-comment
fab fa-apple
fas fa-arrow-up
far fa-closed-captioning
Tables Docs »
<table class="table">
# | Column B | Column C | Column D |
---|---|---|---|
1 | Value B1 | Value C1 | Value D1 |
2 | Value B2 | Value C2 | Value D2 |
3 | Value BC3 | Value D3 |
<table class="table table-striped">
# | Column B | Column C | Column D |
---|---|---|---|
1 | Value B1 | Value C1 | Value D1 |
2 | Value B2 | Value C2 | Value D2 |
3 | Value BC3 | Value D3 |
<table class="table table-bordered">
# | Column B | Column C | Column D |
---|---|---|---|
1 | Value B1 | Value C1 | Value D1 |
2 | Value B2 | Value C2 | Value D2 |
3 | Value BC3 | Value D3 |
<table class="table table-sm">
# | Column B | Column C | Column D |
---|---|---|---|
1 | Value B1 | Value C1 | Value D1 |
2 | Value B2 | Value C2 | Value D2 |
3 | Value BC3 | Value D3 |
<table class="table table-bordered table-sm table-striped table-hover">
# | Column B | Column C | Column D |
---|---|---|---|
1 | Value B1 | Value C1 | Value D1 |
2 | Value B2 | Value C2 | Value D2 |
3 | Value BC3 | Value D3 |
<table class="table table-borderless">
# | Column B | Column C | Column D |
---|---|---|---|
1 | Value B1 | Value C1 | Value D1 |
2 | Value B2 | Value C2 | Value D2 |
3 | Value BC3 | Value D3 |
Alerts Docs »
<div class="alert alert-primary" role="alert">
Warning
A more advanced dismissible warning alert with an example link and some additional HTML. It might even have a button like this. ActionColors
Colors must be used responsibly so that text is accessible, complying with WCAG2.1 Level AA guidelines. Text must have a contrast ratio of at least 4.5:1 compared to its background (3:1 for large-scale text).
Duke Brand Guide Colors
Wherever possible, we should use these colors from the Duke Brand Guide. Consult the guide's Color Accessibility grid to ensure proper usage.
DUL Colors
These variables are used in buttons, alerts, and other Bootstrap elements.
Color Variants
You may need to darken or lighten a color, especially to get it to contrast enough with its background. In these cases, use our custom Sass functions for tint
and shade
.
Tint (adds white)
background-color: tint($dul-masthead-blue, 10%);
Shade (adds black)
background-color: shade($dul-masthead-blue, 10%);
Tabs Docs »
Vertical Tabs (Search Resources)
Horizontal Tabs
Cards Docs »
Image Card
Some quick example text to build on the card title and make up the bulk of the card's content.
Go somewhere.card
.card-img-body
.card-body
Card Title Here
With supporting text below as a natural lead-in to additional content.
.card
.card-header
.card-body
.card
.card-header
.list-group.list-group-flush
Primary card title
Some quick example text to build on the card title and make up the bulk of the card's content.
.card.bg-primary
Some quick example text to build on the card title and make up the bulk of the card's content.
.card.bg-warning
Some quick example text to build on the card title and make up the bulk of the card's content.
.card.bg-info
Images
Uploading to Media Library
In the WYSIWYG editor, place your cursor where you'd like the image to render and click the Insert from Media Library
button. Upload your (large) image file. Media Library will create smaller derivative sizes for you.
Provide alt
text for accessibility. Click Save and Insert
.
Drupal will create a <drupal-media>...</drupal-media>
tag in the page markup.
Image Display Options
Click the Edit Media
button to customize how the image appears. For legacy images, double-click the image.
Choose a size for the image (under Display).
Set image alignment and caption options per below. Legacy images (not using Media Library) may also use these options.
Image Alignment
None data-align=""
Praesent a viverra massa. Mauris nibh augue, mattis eget dolor vel, semper odio. Cras interdum eget ipsum dapibus vehicula. In ut laoreet felis. Sed ac elit mollis, suscipit magna a, volutpat eros. Donec enim libero, consequat at metus eget, eleifend egestas nunc. Integer malesuada mi nibh, quis interdum nisl laoreet a.
Left data-align="left"
Praesent a viverra massa. Mauris nibh augue, mattis eget dolor vel, semper odio. Cras interdum eget ipsum dapibus vehicula. In ut laoreet felis. Sed ac elit mollis, suscipit magna a, volutpat eros. Donec enim libero, consequat at metus eget, eleifend egestas nunc. Integer malesuada mi nibh, quis interdum nisl laoreet a.
Center data-align="center"
Praesent a viverra massa. Mauris nibh augue, mattis eget dolor vel, semper odio. Cras interdum eget ipsum dapibus vehicula. In ut laoreet felis. Sed ac elit mollis, suscipit magna a, volutpat eros. Donec enim libero, consequat at metus eget, eleifend egestas nunc. Integer malesuada mi nibh, quis interdum nisl laoreet a.
Right data-align="right"
Praesent a viverra massa. Mauris nibh augue, mattis eget dolor vel, semper odio. Cras interdum eget ipsum dapibus vehicula. In ut laoreet felis. Sed ac elit mollis, suscipit magna a, volutpat eros. Donec enim libero, consequat at metus eget, eleifend egestas nunc. Integer malesuada mi nibh, quis interdum nisl laoreet a.
Image Captions data-caption="Here is my caption."
Check Captions
in the Edit Media options.
Click the yellow box under the image to enter a caption.
Caption Under Left-Aligned Image data-align="left"
Praesent a viverra massa. Mauris nibh augue, mattis eget dolor vel, semper odio. Cras interdum eget ipsum dapibus vehicula. In ut laoreet felis. Sed ac elit mollis, suscipit magna a, volutpat eros. Donec enim libero, consequat at metus eget, eleifend egestas nunc. Integer malesuada mi nibh, quis interdum nisl laoreet a.
Caption Under Center-Aligned Image data-align="center"
Praesent a viverra massa. Mauris nibh augue, mattis eget dolor vel, semper odio. Cras interdum eget ipsum dapibus vehicula. In ut laoreet felis. Sed ac elit mollis, suscipit magna a, volutpat eros. Donec enim libero, consequat at metus eget, eleifend egestas nunc. Integer malesuada mi nibh, quis interdum nisl laoreet a.
Caption Under Right-Aligned Image data-align="right"
Praesent a viverra massa. Mauris nibh augue, mattis eget dolor vel, semper odio. Cras interdum eget ipsum dapibus vehicula. In ut laoreet felis. Sed ac elit mollis, suscipit magna a, volutpat eros. Donec enim libero, consequat at metus eget, eleifend egestas nunc. Integer malesuada mi nibh, quis interdum nisl laoreet a.
Miscellaneous
Accordions Docs »
accordionExample
. Open the other panes for more tips.data-parent="accordionExample"
, so only one part will be open at a time.data-toggle
, data-target
, aria-controls
, aria-expanded
. Collapsable elements must have: class="collapse"
, aria-labelledby
, data-parent
.Utility Classes Docs »
Use HTML classes instead of CSS for common layout needs.
Example spacing classes:
m-0
- no marginp-0
- no paddingmt-1
- a little top marginmt-5
- a big top marginpl-3
- some left padding
Example display classes:
d-none
- don't displayd-lg-block
- display as block for large screensd-inline
- display inlined-none d-xl-block
- visible only on xl screens
Striped Box
<div class="striped-back">...</div>
More Info
See Bootstrap 4's markup reference for more code and examples.
Our Duke Libraries Drupal site uses a custom theme called Dulcet, based on the Bootstrap-enabled Radix Drupal base theme. We layer in additional base styles from Bootswatch.com's Cosmo Theme. Styles are written as SCSS files, compiled to CSS via Webpack & Yarn.