Skip to content

Conversation

@emplums
Copy link

@emplums emplums commented Feb 19, 2019

Sets the default font weight for the Heading component to 600 and moves the default text size into the styled-component declaration

Closes #402

Merge checklist

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

@emplums emplums requested a review from shawnbot February 19, 2019 08:07
@emplums emplums changed the base branch from master to release-11.0.0 February 19, 2019 19:19

const Heading = styled(Base)`
font-weight: ${get('fontWeights.bold')};
font-size: ${get('fontSizes.5')};
Copy link
Contributor

@colebemis colebemis Feb 19, 2019

Choose a reason for hiding this comment

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

Is there a heuristic for deciding whether to set default styles in the styled call vs in defaultProps? It looks like we do both in this component.

Copy link
Author

Choose a reason for hiding this comment

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

Yeah so, if you set the default in defaultProps you can't pull custom theme values from a user provided theme, so ideally default values should always be set in styled if you'd like to be able to do that. For the margin value here tbh I should probably move that into styled as well

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh gotcha. That makes sense 👍

@emplums emplums merged commit f08d121 into release-11.0.0 Feb 19, 2019
@emplums emplums deleted the heading-bold branch February 19, 2019 23:50
@emplums emplums mentioned this pull request Feb 20, 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