flm-core 0.6.0

FLM semantic markup framework — core library, built on techy
Documentation
/* flm.cells.style */
/* Tables of cells.  The table's outline, a line above it and a line below
   it, is drawn on the table itself; a column header has a line under it; a
   cell has a line at each edge that its data-flm-rules attribute lists,
   regardless of the other cells; a cell's alignment is its data-flm-align
   attribute, and a cell without one, a header cell included, is aligned to
   the left; the four custom cell styles that the cells feature ships are
   backgrounds.  A table that is a float's content is centered in the float.
   Every adjustable value (each spacing, line and color, and the default
   alignment) is a custom property declared on :root below, and apart from
   that :root rule, every selector begins with a class of the HTML contract
   (the classes and attributes that the HTML backend promises to write). */
@layer flm {
  :root {
    /* The space above and below a table, and around the text of a cell. */
    --flm-cells-spacing: 1em;
    --flm-cells-padding: 0.3em 0.5em;
    /* The alignment of a cell that states none. */
    --flm-cells-align: left;
    /* The lines above and below a table, under a column header, and at the
       edges that a cell lists. */
    --flm-cells-outline: 1pt solid;
    --flm-cells-header-rule: 0.5pt solid;
    --flm-cells-rule: 0.5pt solid;
    /* The backgrounds of the custom cell styles green, blue, yellow and
       red. */
    --flm-cells-green: #d8f0d8;
    --flm-cells-blue: #d8e4f8;
    --flm-cells-yellow: #f8f0c8;
    --flm-cells-red: #f8d8d8;
  }

  /* The table: spaced above and below, its outline drawn on it, the lines
     of neighboring cells drawn once, and as wide as its cells where it is
     placed in a grid, such as a list entry laid out as a grid. */
  .flm-pres-cells {
    margin: var(--flm-cells-spacing) 0;
    justify-self: start;
    border-collapse: collapse;
    border-top: var(--flm-cells-outline);
    border-bottom: var(--flm-cells-outline);
    text-align: var(--flm-cells-align);
  }

  /* A table that is the first or the last child of its container (for
     example a cell of another table) takes no space above or below it
     there, as a paragraph in the same place takes none. */
  .flm-pres-cells:first-child {
    margin-top: 0;
  }
  .flm-pres-cells:last-child {
    margin-bottom: 0;
  }

  /* A table that is a float's content: centered, with no space of its own
     above or below, since the float has its own spacing. */
  .flm-floats-float-content > .flm-pres-cells {
    margin: 0 auto;
  }

  /* A cell. */
  .flm-pres-cells td,
  .flm-pres-cells th {
    padding: var(--flm-cells-padding);
  }

  /* A column header: a line under it. */
  .flm-pres-cells th[scope="col"] { border-bottom: var(--flm-cells-header-rule); }

  /* A cell's own lines, set edge by edge. */
  .flm-pres-cells [data-flm-rules~="above"] { border-top: var(--flm-cells-rule); }
  .flm-pres-cells [data-flm-rules~="below"] { border-bottom: var(--flm-cells-rule); }
  .flm-pres-cells [data-flm-rules~="left"] { border-left: var(--flm-cells-rule); }
  .flm-pres-cells [data-flm-rules~="right"] { border-right: var(--flm-cells-rule); }

  /* A cell's alignment. */
  .flm-pres-cells [data-flm-align="left"] { text-align: left; }
  .flm-pres-cells [data-flm-align="center"] { text-align: center; }
  .flm-pres-cells [data-flm-align="right"] { text-align: right; }

  /* The custom cell styles that the cells feature ships. */
  .flm-pres-cells [data-flm-style-green] { background: var(--flm-cells-green); }
  .flm-pres-cells [data-flm-style-blue] { background: var(--flm-cells-blue); }
  .flm-pres-cells [data-flm-style-yellow] { background: var(--flm-cells-yellow); }
  .flm-pres-cells [data-flm-style-red] { background: var(--flm-cells-red); }
}