Skip to content

Commit

Permalink
feat(image): add 'default-image' ::part (carbon-design-system#10450)
Browse files Browse the repository at this point in the history
### Related Ticket(s)

Closes carbon-design-system#10380

### Description

Adds `part` property with value of `image` to the rendered `<img>` tag.

### Testing Instructions

In the styles tab of the devtools, add a new style targeting `dds-image::part(image)`, and note that style added here impact the shadow root's `<img>` tag.

Would be good to have @dratzenboeck-ibm provide an SVG file with `#svgView` parameter to test with.

### Changelog

**New**

- dds-image::part(image)
  • Loading branch information
andy-blum authored May 17, 2023
1 parent 81a2fd2 commit 964713c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/web-components/src/components/image/image.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright IBM Corp. 2020, 2022
// Copyright IBM Corp. 2020, 2023
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
Expand Down
1 change: 1 addition & 0 deletions packages/web-components/src/components/image/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ class DDSImage extends StableSelectorMixin(
src="${defaultSrc}"
alt="${alt}"
aria-describedby="image-caption long-description"
part="image"
loading="lazy" />
</picture>
<div id="long-description" class="${prefix}--image__longdescription">
Expand Down
2 changes: 2 additions & 0 deletions packages/web-components/tests/snapshots/dds-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
aria-describedby="image-caption long-description"
class="bx--image__img"
loading="lazy"
part="image"
src=""
>
</picture>
Expand All @@ -39,6 +40,7 @@
aria-describedby="image-caption long-description"
class="bx--image__img"
loading="lazy"
part="image"
src=""
>
</picture>
Expand Down

0 comments on commit 964713c

Please sign in to comment.