list: punctuated

view source

Punctuate an HTML list.

use-name
scut-list-punctuated
type
mixin, with extension placeholder(s)
arguments
  1. $divider
    default
    ", "
  2. $display
    default
    inline

    Change to inline-block if you don't want your list items spanning lines.

  3. $no-margin
    default
    true

    If true, top and bottom margins will be removed from the list.

compatibility

This utility uses the :not and :last-child selectors, which are not supported in IE8 without a polyfill.

Keep your HTML semantic and your punctuation traditional.

Since the most common punctuated list uses commas, commas are the default $divider and the comma list is available as its own placeholder:

  • %scut-list-comma

Only the list's immediate children are punctuated (ul > li): Scut does not presume to know what you plan to do with sub-lists.

example

SCSS

.eg-punctuated-list {
  @include scut-list-punctuated;
  // or @extend %scut-list-comma;
}
.eg-semicolon-list {
  @include scut-list-punctuated("; ", $no-margin: false);
}
.eg-circle-list {
  @include scut-list-punctuated("\0020\2022\0020");
}

Result

  • list item
  • list item
  • list item
  • list item
  • list item
  • list item
  • list item
  • list item
  • list item