Robert Birming

Bear Blog text shorthands

The default Bear Blog theme keeps things plain, no built-in way to center a block, add some subtle text, or drop in a custom divider. A handful of small classes fill that gap.

Simply wrap your content in a div and add the class, no extra markup or thinking required. Mix and match, combine them, tweak the values, or use them as a starting point for your own styles.

Last updated 1 week, 5 days ago.


Centered text

Centered text example

Markup

<div class="center">
Your content.
</div>

Styles

.center {
    text-align: center;
}

Subtle text

Subtle text example

Markup

<div class="meta">
Your content.
</div>

Styles

.meta {
    font-size: calc(var(--font-scale) * 0.85);
    color: color-mix(in srgb, var(--text-color), transparent 40%);
}

Pull quote

Pull quote example

Markup

<div class="pullquote">
Your content.
</div>

Styles

.pullquote {
    font-size: 1.35em;
    line-height: 1.4;
    text-align: center;
    padding-inline: 1em;
    font-style: italic;
}

Callout note

Callout note example

Markup

<div class="callout">
A quick note before you continue.
</div>

Styles

.callout {
    border: 1px dashed color-mix(in srgb, var(--text-color), transparent 50%);
    border-radius: 3px;
    padding: 8px 12px;
    font-size: small;
    text-align: center;
}

Dividers

Divider styles example

Markup

<div class="solid-divider"></div>
<div class="double-divider"></div>
<div class="symbol-divider">ʕ•ᴥ•ʔ</div>
<div class="short-divider"></div>
<div class="dots-divider"></div>
<div class="curve-divider"></div>

Styles

.solid-divider {
    height: 1px;
    margin-block: 1.5rem;
    background: color-mix(in srgb, var(--text-color), transparent 78%);
}

.double-divider {
    height: 5px;
    margin-block: 1.5rem;
    border-block-start: 1px solid color-mix(in srgb, var(--text-color), transparent 78%);
    border-block-end: 1px solid color-mix(in srgb, var(--text-color), transparent 78%);
}

.symbol-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-block: 1.5rem;
    color: color-mix(in srgb, var(--text-color), transparent 40%);
}

.symbol-divider::before,
.symbol-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: color-mix(in srgb, var(--text-color), transparent 78%);
}

.short-divider {
    width: 20rem;
    height: 1px;
    margin-block: 1.5rem;
    margin-inline: auto;
    background: color-mix(in srgb, var(--text-color), transparent 78%);
}

.dots-divider {
    text-align: center;
    margin-block: 1.5rem;
    color: color-mix(in srgb, var(--text-color), transparent 40%);
    letter-spacing: 0.35em;
}

.dots-divider::before {
    content: "• • •";
}

.curve-divider {
    width: 8rem;
    height: 0.5rem;
    margin-block: 1.5rem;
    margin-inline: auto;
    background: var(--link-color);
    opacity: 0.9;
    -webkit-mask:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='8' viewBox='0 0 120 8'><path d='M0 4 Q30 0 60 4 T120 4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/></svg>")
        no-repeat center / contain;
    mask:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='8' viewBox='0 0 120 8'><path d='M0 4 Q30 0 60 4 T120 4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/></svg>")
        no-repeat center / contain;
}

@supports not ((mask: url("")) or (-webkit-mask: url(""))) {
    .curve-divider {
        height: 0.125rem;
        border-radius: 999px;
    }
}

Combining styles example

Combined text styles example

Markup

<div class="center meta">
Your content.
</div>

Uses the .center and .meta classes above, no new CSS needed.

Want more? Check out the full Bear Blog library.