You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Factor out any instances of theme.colors.bg and theme.colors.border, since those aren't there anymore. Some components used these to fill in the gaps left by our CSS components. Please leave notes in Add docs for migrating to system props #161 if you come across any gotchas.
For components with only system props (system components?), we can get by with snapshot tests for now. Snapshots are stored in git, so we can look at them after the first run (when jest prompts us to update them) and spot-check the files generated in src/__tests__/__snapshots__ for any potential issues.
Use the expect(render(<X />)).toHaveStyleRule() to test individual style props. For props that are based on the theme, you can import theme from '../theme' and pass theme={theme}, then compare the style rule value to the one in the theme. Note that it's not currently possible to test responsive props. See Refactor tests to work with emotion #165 for more info.
For components that render system components (X = props => <Block {...props} />), be sure to spread the base component's propTypes into your components' prop-types.
Rename all tag props to is to match styled-system conventions.
Replace all instances of color names without a step (red) with "stepped" equivalents (red.5) in all three color props: bg, color, and borderColor (see First stab at migration docs #185 for info). @emplums
Replace all instances of tag="foo" with is="foo"@emplums
Etc.
src/props.js needs to be reorganized, and many of the helper functions from this can go. Once we're finished with the component migration, we can use eslint to figure out which functions aren't used anymore. @shawnbotStyled system wrap-up, test fixes #203
What to do
Factor out any instances of
theme.colors.bg
andtheme.colors.border
, since those aren't there anymore. Some components used these to fill in the gaps left by our CSS components. Please leave notes in Add docs for migrating to system props #161 if you come across any gotchas.Add common system props. See
contributing.md
(introduced in initial contributing/dev docs #180) for details.Refactor tests to get them passing again.
For components with only system props (system components?), we can get by with snapshot tests for now. Snapshots are stored in git, so we can look at them after the first run (when jest prompts us to update them) and spot-check the files generated in
src/__tests__/__snapshots__
for any potential issues.Use the
expect(render(<X />)).toHaveStyleRule()
to test individual style props. For props that are based on the theme, you canimport theme from '../theme'
and passtheme={theme}
, then compare the style rule value to the one in the theme. Note that it's not currently possible to test responsive props. See Refactor tests to work with emotion #165 for more info.For components that render system components (
X = props => <Block {...props} />
), be sure to spread the base component'spropTypes
into your components' prop-types.Rename all
tag
props tois
to match styled-system conventions.Components
src/Avatar.js
) @emplums Make Avatar Emo #170src/Block.js
) @shawnbot Introduce emotion and styled-system #164Box ((TBD, see Update Block component to be called Box again #189)src/Box.js
) [DELETE] @emplumssrc/BranchName.js
) @emplums Update BranchName to use emotion #178src/Button.js
) @emplums Update Button + variations to emotion + styled-system #181src/ButtonDanger.js
) @emplums Update Button + variations to emotion + styled-system #181src/ButtonLink.js
) @emplums Update Button + variations to emotion + styled-system #181src/ButtonOutline.js
) @emplums Update Button + variations to emotion + styled-system #181src/ButtonPrimary.js
) @emplums Update Button + variations to emotion + styled-system #181Caret (src/Caret.js
) @emplums Update Caret with emotion #184src/CaretBox.js
) @emplums @shawnbot (multiple PRs)src/CircleBadge.js
) @emplums Update CircleBadge to use Emotion + Styled System #195src/CircleOcticon.js
) @emplums - No changes necessarysrc/CounterLabel.js
) @emplums Update CounterLabel to use Styled System & Emotion #196src/Details.js
) @shawnbot Styled Details #194src/DonutChart.js
) @shawnbot Styled Donut Charts #183src/DonutSlice.js
) @shawnbot Styled Donut Charts #183src/Dropdown.js
) @shawnbot Migrate Dropdown to system props, fix border prop issue #192src/Flash.js
) @shawnbotsrc/FlexContainer.js
) @shawnbotsrc/FlexItem.js
) @shawnbotsrc/Label.js
) @shawnbotsrc/Heading.js
) @shawnbotsrc/Link.js
) @jonrohan Upgrading Link.js to styled-system #169src/MergeStatus.js
) @jonrohan Updating MergeStatus.js to styled-systems emotion #171src/OcticonButton.js
) @jonrohan Updating OcticonButton.js to styled-systems emotion #172src/StateLabel.js
) @jonrohan Updating StateLabel.js to styled-systems emotion #173src/Text.js
) @shawnbotsrc/TextInput.js
) @jonrohan Updating TextInput.js to styled-systems emotion #174src/Tooltip.js
) @jonrohan Updating Tooltip.js to styled-systems emotion #176src/UnderlineNav.js
) @jonrohan Updating UnderlineNav.js to styled-systems emotion #177src/UnderlineNavLink.js
) @jonrohan Updating UnderlineNavLink.js to styled-systems emotion #179Docs / Examples
red
) with "stepped" equivalents (red.5
) in all three color props:bg
,color
, andborderColor
(see First stab at migration docs #185 for info). @emplumstag="foo"
withis="foo"
@emplumsEtc.
src/props.js
needs to be reorganized, and many of the helper functions from this can go. Once we're finished with the component migration, we can use eslint to figure out which functions aren't used anymore. @shawnbot Styled system wrap-up, test fixes #203src/theme.js
may need some love to match up with all of the styled-system functions @shawnbotThe text was updated successfully, but these errors were encountered: