Robert Birming

List styles

  1. Bear Blog library
  2. Styles

The default Bear Blog theme keeps the blog list simple, a plain list of dates and titles, no dividers or extra spacing. I'm here to offer you some more options.

This page collects small CSS tweaks and variations for the layout and structure of the blog list. Each one works out of the box, but they're just as much meant as a starting point. Mix and match, tweak the values, or use them to learn more about theme styling.

Last updated 5 days, 10 hours ago.

Divider

Divider list

/* List: divider | robertbirming.com */
ul.blog-posts li {
  padding-block: 0.5em;
  border-block-end: 1px solid color-mix(in srgb, var(--text-color), transparent 85%);
}

ul.blog-posts li:last-child {
  border-block-end: none;
}

Split

Split list

/* List: split | robertbirming.com */
ul.blog-posts {
  border-block: 1px solid color-mix(in srgb, var(--text-color), transparent 85%);
}

ul.blog-posts li {
  padding-block: 0.5em;
  border-block-end: 1px solid color-mix(in srgb, var(--text-color), transparent 85%);
}

ul.blog-posts li:last-child {
  border-block-end: none;
}

ul.blog-posts li a {
  order: 1;
  flex: 1;
  min-width: 0;
}

ul.blog-posts li span {
  order: 2;
  flex: 0 0 auto;
  margin-inline-start: auto;
  white-space: nowrap;
}

Cards

Card list

/* List: cards | robertbirming.com */
ul.blog-posts li {
  align-items: baseline;
  margin-block-end: 0.6em;
  padding-block: 0.8em;
  padding-inline: 1em;
  background: color-mix(in srgb, var(--text-color), var(--background-color) 94%);
  border-radius: 8px;
}

ul.blog-posts li a {
  order: 1;
  flex: 1;
  min-width: 0;
}

ul.blog-posts li span {
  order: 2;
  flex: 0 0 auto;
  margin-inline-start: auto;
  white-space: nowrap;
}

ul.blog-posts li span time {
  font-size: 0.85em;
}

Stacked

Stacked list

/* List: stacked | robertbirming.com */
ul.blog-posts li {
  display: block;
  margin-block-end: 1em;
}

ul.blog-posts li span {
  display: block;
  margin-block-start: 0.15em;
  font-size: 0.85em;
  color: color-mix(in srgb, var(--text-color), transparent 40%);
}

Boxed

Boxed list

/* List: boxed | robertbirming.com */
ul.blog-posts {
  padding: 0.5em 1em;
  background: color-mix(in srgb, var(--text-color), var(--background-color) 94%);
  border-radius: 8px;
}

ul.blog-posts li {
  padding-block: 0.6em;
  border-block-end: 1px solid color-mix(in srgb, var(--text-color), transparent 85%);
}

ul.blog-posts li:last-child {
  border-block-end: none;
}

Timeline

Timeline list

/* List: timeline | robertbirming.com */
ul.blog-posts {
  padding-inline-start: 1.2em;
  border-inline-start: 2px solid var(--link-color);
}

ul.blog-posts li {
  position: relative;
  padding-block: 0.4em;
}

ul.blog-posts li::before {
  content: "";
  position: absolute;
  inset-inline-start: -1.45em;
  inset-block-start: 0.9em;
  width: 8px;
  height: 8px;
  background: var(--link-color);
  border-radius: 50%;
}

Dotted leaders

Dotted leaders list

/* List: dotted leaders | robertbirming.com */
ul.blog-posts li {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  padding-block: 0.4em;
}

ul.blog-posts li a {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

ul.blog-posts li::after {
  content: "";
  flex: 1;
  border-block-end: 1px dotted color-mix(in srgb, var(--text-color), transparent 75%);
}

ul.blog-posts li span {
  order: 3;
  flex: 0 0 auto;
}

ul.blog-posts li span time {
  font-size: 0.9em;
}

Alternating rows

Alternating rows list

/* List: alternating rows | robertbirming.com */
ul.blog-posts li {
  padding-inline: 0.6em;
}

ul.blog-posts li:nth-child(odd) {
  background: color-mix(in srgb, var(--text-color), transparent 96%);
}

No date

No date list

/* List: no date | robertbirming.com */
ul.blog-posts li {
  padding-block: 0.3em;
  font-weight: 600;
}

ul.blog-posts li span {
  display: none;
}

Have fun finding a list that fits your blog.

Want more? Check out the full Bear Blog library.