-
Notifications
You must be signed in to change notification settings - Fork 645
BorderBox and related (breaking) changes #761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/primer/primer-components/jsen2oaf0 |
4fb1397 to
d6dba25
Compare
|
This should be ready for review. /cc @emplums |
|
One thing I noticed while going through the type definitions - |
@emplums Currently we add export const BORDER = compose(styledSystem.border, styledSystem.shadow)
BORDER.propTypes = {
...systemPropTypes.border,
...systemPropTypes.shadow
}I could see a theoretical argument that borders and shadows are similarish, but don't have strong opinions. Would we move it to |
|
@BinaryMuse on second thought, I think it's fine to just leave in BorderBox, but could you add an example to the BorderBox docs showing box shadow usage? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few more comments but once those are resolved I think this is good to go!
|
I added all the border colors from Primer CSS, including the I also pulled in polished so we can stop hardcoding mysterious hex and rgba values all over the place. - grayLight: '#eaecef',
+ grayLight: lighten(0.03, gray[2]), |

As discussed in #510, this PR will be adjusting
BorderBoxand related components as follows:Boxwill receiveFLEXpropsFlexwill bedisplay: flexby default but otherwise is identical toBoxBorderBoxwill have itsborderdefault prop split intoborderWidthandborderStyle.This is a breaking change that will have ramifications for many of our own components and also for Doctocat; a migration strategy will be included.
Thesxprop will be made available to all componentsThe implementation of thesxprop is still in progress, although we seem to have a path forward. I also want to ensure we have good documentation around the prop, especially around when it should and should not be used.Moving this task to its own PR
Closes #510
Doctocat shadowing
A number of components in Doctocat use shorthand border properties to modify the border on
BorderBox(as shown in the release notes section below). These components have been shadowed in this PR; once it ships, the Doctocat components can be changed and these shadowing files can be removed.Release Notes
BorderBoxhas had its defaultborderprop split intoborderWidthandborderStyle:before:
after:
While this change was made to fix bugs in the ability to modify
BorderBox's border, it is also a breaking change if you useborderorborder<Direction>shorthand props to modify the border, as these will no longer work. Instead, use non-shorthand props. For example, changeto
Box(and components that inherit from it, likeBorderBox) now have access toFLEXsystem props.Flexnow behaves exactly likeBoxexcept that it has itsdisplayprop set toflexby default.Flex.Itemhas been removed in favor ofBox, which now has all the same props.theme.bordershas been removed; use the newborderWidthstheme values forborderWidthproperties (0is a width of0,1is a width of1px).The following colors have been added:
Merge checklist
index.d.ts) if necessary