jpmorganchase / salt-ds

React UI components built with a focus on accessibility, customisation and ease-of-use
https://www.saltdesignsystem.com
Apache License 2.0
111 stars 78 forks source link

Salt Heading components should set margin to 0 #2517

Open ZarkoPernar opened 9 months ago

ZarkoPernar commented 9 months ago

Package name(s)

Core (@salt-ds/core)

Package version(s)

1.8.1

Description

Heading elements (h1,h2,h3) have margins by default in most browsers. This makes them hard to compose with something like our layout components. It is pretty much guarateed our users will have to reset the css anyways if we recommend them to use them with layout components.

Steps to reproduce

<StackLayout gap={1}>
  <H1>Heading 1</H1>
  <Text>Lorem ipsum...</Text>
</StackLayout>

Expected behavior

The example above should have the text and heading only have the gap spacing in between.

Operating system

Browser

Are you a JPMorgan Chase & Co. employee?

lukeac123 commented 9 months ago

@ZarkoPernar I'm not sure i fully understand the issue. Does this not solve the problem ? <StackLayout align'start'>

mark-tate commented 8 months ago

reset the margins in global styles

joshwooding commented 8 months ago

Removed priority and moved back to triage. We need to figure out if this is a bug or an enhancement.

I don't know if we should globally reset headers. There are some components which would need it, e.g. Accordion. But a global reset could affect elements we don't intend to. There's a question about whether we should make removing the margin on our Salt Text component easier, but that would require design input @jpmorganchase/salt-design.

Personally, I think putting a header and text in a flex container is probably not what most developers would do and instead would expect their to be margin on the headers like there is natively.

origami-z commented 8 months ago

We should consider spacing guide (Figma) coming out from DP content work being the "design input', having browser default will not work well. We need to pick a technical implementation recommendation and go with it.