Skip to content

Phantom Types: Contributing

Richard Feldman edited this page Apr 22, 2018 · 7 revisions

See #375 for background.

Implementation Guidelines

Previously the linking policy was to either link to MDN or not to bother writing documentation (e.g. have {-| -} for a doc comment.) The new policy is to have documentation for every value, including at least one code example, and which links to relevant documentation on that property.

I originally linked to MDN for all the docs, but I've since discovered CSS Tricks has some really well-written guides on how to use various properties and values in practice, and those articles tend to link to MDN documentation at the end anyway. So the new policy is to link to CSS Tricks if there's an appropriate article for that value, and to fall back on linking directly to MDN if CSS Tricks happens not to have anything relevant.

Don't worry about tests for now. I decided against trying to get them compiling along the way; seems easier to wait until everything is converted, at which point the tests will hopefully reveal any accidental regressions in implementations.

Contribution Checklist

  • Each Value is an open record with a single field. The field's name is the value's name, and its type is Supported. For example foo : Value { provides | foo : Supported }
  • Each function returning Style accepts a closed record of Supported fields, which always includes inherit, initial, and unset because all CSS properties support those three values! For example, borderFoo : Value { foo : Supported, bar : Supported, inherit : Supported, initial : Supported, unset : Supported } -> Style
  • Every exposed value has documentation which includes at least 1 code sample.
  • Documentation links to to a CSS Tricks article if available, and MDN if not.
  • Make a pull request against the phantom-types branch, not master!
Clone this wiki locally