Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
290 stars 75 forks source link

[Tab] Add css custom property to override built-in padding #8413

Closed macandcheese closed 9 months ago

macandcheese commented 11 months ago

Check existing issues

Description

Currently, Tab provides built in y-padding that is not overridable in a supported way.

Acceptance Criteria

We should expose a css custom property, such as --calcite-tab-padding. This aligns with Block, Modal, and other components where built-in padding is provided.

Relevant Info

Related to this comment: https://github.com/Esri/calcite-design-system/issues/8139#issuecomment-1830397218

Which Component

Tab / Tabs

Example Use Case

As a user, I want to have a full-height content in a Tab, with no built-in padding.

Priority impact

p4 - not time sensitive

Calcite package

Esri team

Calcite (design)

RSantosGIS commented 11 months ago

Adding from our Teams thread I brought up:

I just updated Studio to Calcite 2.1 from 1.9. I noticed that padding is now being applied to the CalciteTab " element, which is causing our layout to get thrown off and creating an undesirable white stripe above the content. Is there a way to turn off this padding, similar to the x-content-padding prop that exists on other components, or some kind of recommended way to do this?

It looks like the difference is occurring because of a change to the way the padding-block style is being applied. It looks like with the old way, it was a non-inheritable property and so was never actually applied (perhaps your team considered this a bug?), but the new selector is being applied in 2.1 and I can't figure out a way to override it.

Please see the screenshots below:

1.9 (no padding, desired) image (4)

2.1 (padding, not desired) image (5)

RSantosGIS commented 10 months ago

Adding a follow up comment on this due to the recent R1 completion announcement. This is a style regression in ArcGIS Knowledge Studio. If the proposed property isn't going to make it, we need some kind of guidance on a way to hack/workaround to remove the padding.

github-actions[bot] commented 10 months ago

Installed and assigned for verification.

geospatialem commented 9 months ago

Verified in 2.3.0-next.1 with https://codepen.io/geospatialem/pen/ZEPXOWL with the tab's new CSS property of --calcite-tab-content-block-padding.

cc @RSantosGIS the property can also specify a value of 0 to support the use case.

<calcite-tab style="--calcite-tab-content-block-padding: 0;">
   ...
</calcite-tab>