-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Components: promote Surface
#32439
Components: promote Surface
#32439
Conversation
|
||
Determines the grid size for "dotted" and "grid" variants. | ||
|
||
##### border | ||
### `border`: `boolean` |
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.
I'm not personally sure about the APIs around border
.
Currently, there are 5 different props:
border
shows the border on all four sidesborder{Top,Left,Right,Bottom}
each show one individual border
It feels a bit weird to me that there is partial overlap between them — i.e. that if border
is true
, all other props become meaningless
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.
Agreed, this doesn't make much sense to me, especially if we consider how borders behave in CSS. I guess it makes sense that the border*
take precedence over border
, but that might also require a change in the default values of those props.
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.
Regardless of what we decide here, it makes sense to document how all those border props behave, and which one takes precedence over the other(s).
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.
Probably the easiest solution that I see is to remove the border
prop, and leave the remaining individual props as they are. That would avoid overlaps and only make setting a border around the whole surface a bit more verbose.
WDYT?
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.
I'd say I can see some value in having them separate, but I'd likely have the border*
default to the current value of border
of not specified. I think that would be easy, too, and would solve the problem, while still resembling how border specificity works in CSS. What do you think about that?
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.
As discussed with @tyxla , we decided to remove the border
prop for now and simplify the component's APIs
Size Change: +546 B (0%) Total Size: 1.03 MB
ℹ️ View Unchanged
|
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.
Looks good and tests well for me 👍
@@ -44,7 +44,8 @@ | |||
"src/h-stack/**/*", | |||
"src/v-stack/**/*", | |||
"src/z-stack/**/*", | |||
"src/view/**/*" | |||
"src/view/**/*", | |||
"src/surface/**/*" |
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.
Nit: seems like we don't quite follow an alphabetical sorting order here
|
||
Determines the grid size for "dotted" and "grid" variants. | ||
|
||
##### border | ||
### `border`: `boolean` |
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.
Agreed, this doesn't make much sense to me, especially if we consider how borders behave in CSS. I guess it makes sense that the border*
take precedence over border
, but that might also require a change in the default values of those props.
|
||
Determines the grid size for "dotted" and "grid" variants. | ||
|
||
##### border | ||
### `border`: `boolean` |
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.
Regardless of what we decide here, it makes sense to document how all those border props behave, and which one takes precedence over the other(s).
45c8f4a
to
f9761ed
Compare
Description
Promote the
Surface
component from thepackages/components/src/ui
to thepackages/components/src
folder.@wordpress/components
as__experimentalSurface
Testing instructions
trunk
)Screenshots
Types of changes
Refactor
Checklist:
*.native.js
files for terms that need renaming or removal).