Skip to content

Conversation

@colebemis
Copy link
Contributor

@colebemis colebemis commented Feb 19, 2019

Currently, each "system prop" is listed twice in constants.js: once for use with styled-components and once for the docs. It seems like it would be easy for the docs to get out-of-sync if we forget to update both lists every time we make a change to a constant. I wrote a little helper function to avoid having to repeat lists of system props.

Merge checklist

  • Changed base branch to release branch
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Copy link

@emplums emplums left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hell ya! wonderful!

export const FLEX_ITEM = composeList(FLEX_ITEM_LIST)

function composeList(list) {
return compose(...list.map(name => styles[name]))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% sure what the best name for this function and its argument is 🤷‍♂️

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is pretty good naming as is!

@emplums emplums changed the base branch from master to release-11.0.0 February 19, 2019 23:15
@emplums emplums merged commit fec880c into release-11.0.0 Feb 19, 2019
@emplums emplums deleted the dry-constants branch February 19, 2019 23:15
@emplums emplums mentioned this pull request Feb 19, 2019
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants