-
Notifications
You must be signed in to change notification settings - Fork 830
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
evergreen-layers outline #8
Comments
Should specific border properties cancel elevation altogether? or should we issue a warning if they're both used together? |
@nettofarah good question, I was thinking about this too. I thiought there was an exception when you deal with cards and disable border radius on a side, to attach it to something. But seems actually like no real use case for that. Differently from this I initially had backgroundColor with some variables instead of appearances. I think we should add appearance="neutralTint1" going up to maybe 3-5. This might also set a color border if applicable. Not sure about naming just yet. Really appreciate you take the time and give some feedback! Let's make this thing awesome 🔥 |
First pass implemented by PR #9. Had to fix the |
@jeroenransijn is there are Sketch App design file for all the components by any chance? |
The
evergreen-layers
is a package exporting React components and layer/elevation styles.Not entirely sure about some of the API specifics, but have a pretty good idea.
Usage
Design example
<Pane />
componentPane will simply implement
ui-box
with some opinionated properties. It is used pretty much as adiv
orBox
element and acts as a abstraction betweenBox
.The styles will be implemented on a
LayerAppearances
object.Selected appearance
In some cases you want to make the Card interactive, therefore having a selected appearance is often a nice to have.
One way of dealing with the appearance to avoid elevation conflicts is to have the appearance applied after the elevation box shadow, this would cancel out that box shadow.
<Card />
componentThe
Card
component directly implements the Pane component. The only difference is that it comes with opinionated border radius. Generally engineers and designers like to refer to these things as Cards.The standard border radius will be
5px
. Maybe will make this configurable in the future.Elevation property
The
elevation
property determines what kind of box shadow will be set.I don't think there should be a default for the elevation if you don't need a box shadow.
hoverElevation
, andactiveElevation
propertyTo easily allow for interactive cards, having a
hoverElevation
andactiveElevation
is a nice addition. This will have to use the Boxcss
.Elevation box shadows implementation
The box shadows themselves will be implemented on a
ElevationStyles
array.The box shadow is following a technique where you use 2 box shadows, one of which is implemented with a negative spread to avoid blurry sides. Which is sadly not supported by Sketch
The color used right now is for the box shadow acting as a border is
colors.neutral['80A']
. However this has proved somewhat light in some circumstances. This might be bumped up slightly. Or instead of using a blur we'll use a spread.Border property
In the
react-ui-library
(Segment's current internal UI library) there is a shorthand for setting borders on any Box, simply by doing something like the following:I actually have really enjoyed using this API in the past, and I don't see a clear alternative for this.
I am thinking this should still use a actual border. I am not sure how this would work when using
elevation
. Maybe add use a box shadow at that point?I think the border color should be using a neutral color with a alpha channel.
BorderColors
One border color might not be enough for all use cases. In the past this was somewhat annoying.
Instead I think we can do something like:
Usage
You will still be able to pass in any color.
The text was updated successfully, but these errors were encountered: