-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Try adding borderless header variant to Modal #41998
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
Size Change: -22 B (0%) Total Size: 1.25 MB
ℹ️ View Unchanged
|
It looks promising. I'm not hugely into stringly typing these variations, but I know this pattern is being favoured in other components. I like boolean props better because they can be combined (i.e. But if the variant approach is preferred, maybe the guide should have a 'sticky' variant, so that those other styles aren't left behind. The only other option that springs to mind is making a separate |
This is also my general feeling — it feels a bit like the
I also agree with this point — the concept of "variant" works well when the options being represented are mutually exclusive. Daniel's example is fitting — what if the header needs to be borderless AND sticky? On top of that, I'd also advocate for less presentational variant names than "borderless", as they make it hard to update the design of the component in the future without introducing breaking changes / deprecations.
Similarly to this idea, I also think that one way to improve the situation may be to "modularize" the |
Something I wanted to ask @WordPress/gutenberg-design is if it makes sense to have a modal with a border underneath the title and a modal with none? Can we consolidate and choose one design? |
In #40781 the border beneath the modal title is removed unilaterally. It's just waiting approval :) |
Oh perfect @jameskoster. I think #40781 is the better direction to go in then. |
Rough attempt at addressing #41925 (comment).
Basically we hide the border that appears underneath the header in
Modal
in a bunch of places. This isn't ideal as we're depending on an internalModal
class name (.component-modal__header
).My solution is to add a new
headerVariant
prop toModal
. The border can be removed by setting this prop to"borderless"
. I also incorporate the existing__experimentalHideHeader
prop into this by allowingheaderVariant
to be"hidden"
.What do you think @talldan @ciampo?
I'm not so sure. Even with this change, these uses of Modal still reference internal class names a lot. It feels like we're fighting a losing battle..
I note that two of the instances here are asking the user to input some text. Perhaps we could add a new
Prompt
component to compliment the existingConfirm
component.Open to suggestions or to just close this.