Fix problem with parseTextReference not recognising missing indices
Clean up CSS macros

Move the CSS macros into global macros, and allow the colour macro to
fallback to the vanilla palette if the required colour isn’t found in
the current palette.