spectrum-web-components icon indicating copy to clipboard operation
spectrum-web-components copied to clipboard

Missing body slot in card component

Open ejez opened this issue 4 years ago • 2 comments

As per https://spectrum.adobe.com/page/cards/#Anatomy , the card component might have a body section. Screenshot 2021-06-27 at 19-20-20 Spectrum, Adobe’s design system

Is it possible to add a slot for it: https://github.com/adobe/spectrum-web-components/blob/947e81061fb9db8a3f7cb6603cf0ff9b4107f4ae/packages/card/src/Card.ts#L248

                ${this.variant !== 'gallery'
                    ? html`
                          <div class="content">
                              ${this.renderSubtitleAndDescription}
                          </div>
                      `
                    : html``}
+                <slot name="body"></slot>
            </div>
            ${this.variant === 'standard'
                ? html`
                      <slot name="footer"></slot>
                  `
                : html``}

ejez avatar Jun 27 '21 16:06 ejez

Generally, we try not to ship things on the delivery of which we do not have styling direction . In this way, being the body content is not currently included in Spectrum CSS I'm not sure that we'll be shipping this in the near future.

There are active conversations at the Spectrum level around updating the Card content delivery guidelines in a way that may open a path towards offering something like this in the future. In the interim, you might find success in registering a local extension of the element that features this interface.

Westbrook avatar Jul 02 '21 03:07 Westbrook

Thanks for the explanation!

ejez avatar Jul 02 '21 08:07 ejez