Farol.Rules.ContrastToken (Farol v0.2.0)

Copy Markdown View Source

Inline colors, resolved through a declared token map, checked against WCAG AA contrast ratios.

Opt-in: the rule only runs when tokens are declared, since without a token map it cannot know what a color name means. Declare them once and your design system becomes the test fixture:

config :farol, :tokens, %{
  "bg" => "#000A0F",
  "fg" => "#F7F7FF",
  "accent" => "#9655FF"
}