Stylesheet for bibliographic references

This page describes how the extra styles for bibliographic references on this site are generated.

Preamble

As usual, we start with defining the main module, module imports, and writing the CSS stylesheet to standard output.

module Main (main) where

import Clay
import Prelude hiding (div, not)

main :: IO ()
main = putCss biblioStyle

Bibliography

This site uses the citation style used by the Association for Computing Machinery. The stylesheet here is responsible for ensuring that the citation keys are lined up and that there is appropriate spacing between entries.

biblioStyle :: Css
biblioStyle = do
  div # ".csl-bib-body" ? do
    paddingBottom $ em 1

    div # ".csl-entry" ? do
      marginBottom $ em 1

      -- When width is small, break long URLs.
      overflowWrap breakWord

      div # ".csl-left-margin" ? do
        float floatLeft
        width $ em 3
        textAlign $ alignSide sideRight

      div # ".csl-right-inline" ? do
        marginLeft $ em 3
        paddingLeft $ em 1

See also