Skip to content
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

fix(image-with-caption): adjust image button background color #10279

Merged

Conversation

m4olivei
Copy link
Contributor

@m4olivei m4olivei commented Mar 28, 2023

Related Ticket(s)

#10250
https://jsw.ibm.com/browse/ADCMS-3105

Description

Sets the background style to transparent for the <button> element used in the shadow DOM of the <dds-image> and <dds-image-with-caption> components, such that when used with a transparent image (SVG, transparent gif/png), the browser's default button grey does not show through.

Note that the original issue was reported for <dds-image-with-caption>, but the issue equally effects <dds-image> component as well. Note also that the <dds-image-with-caption> button was recently deprecated, it's features merged with <dds-image>. Use of <dds-image-with-caption> should be replaced by <dds-image> (see #8839). The deprecation is documented in the Storybook README for the Image component.

Testing Instructions

  • Open Storybook to the Image > Default component.
  • For the "Default image" Storybook knob, choose "SVG". A transparent SVG is used as the image for the component.
  • Select Lightbox as well from the Storybook knobs
  • Note the browser default button color does not show through.

Changelog

Changed

  • Added background-color: transparent to the button styles for the <dds-image> component when in lightbox mode.

@m4olivei m4olivei added bug Something isn't working dev Needs some dev work package: web components Work necessary for the IBM.com Library web components package adopter: AEM used when component or pattern will be used by this adopter owner: Innovation Team used when the engineering work will be done by Hybrid Cloud with DDS engineers as consultants labels Mar 28, 2023
@m4olivei m4olivei requested a review from a team as a code owner March 28, 2023 15:16
@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Mar 28, 2023

@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Mar 28, 2023

@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Mar 28, 2023

@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Mar 28, 2023

@m4olivei m4olivei requested a review from jwitkowski79 March 28, 2023 15:53
@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Mar 28, 2023

Copy link

@jwitkowski79 jwitkowski79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved from my end! Thanks for working on this

@proeung proeung changed the title Fix image lightbox button background fix(image-with-caption): adjust image button background color Apr 4, 2023
Copy link
Contributor

@proeung proeung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Screen Shot 2023-04-04 at 3 27 02 PM

@carbon-design-system/carbon-for-ibm-com and or @oliviaflory Can we get a review? Thanks!

@proeung proeung added the Needs design approval PRs on feature requests and new components have to get design approval before merge. label Apr 4, 2023
Copy link
Contributor

@oliviaflory oliviaflory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@m4olivei The change looks good from a design perspective

If we are going to keep the SVG as an example demo I'd like to change the knob label to SVG (transparent background) or something like that so it's a bit more clear.

I'll also just ping the over devs to get any ideas for a better placement (if we're keeping it)

@m4olivei
Copy link
Contributor Author

m4olivei commented Apr 5, 2023

@kennylam
Copy link
Member

kennylam commented Apr 6, 2023

@m4olivei There actually is a custom loader being used, but it's never played nice with assets loaded in Storybook (gotta fix that). In the meantime, I think the best way would be to take the data and put it into its own file, e.g. image/__stories__/chartSVG.js?

const foo = 'monster-encoded-chunk-of-text';

export default foo;

Then you can just import as usual and use that in images object. There are a few stories with external data files for the sake of keeping the stories less cluttered. What do you think?

@m4olivei
Copy link
Contributor Author

m4olivei commented Apr 6, 2023

In the meantime, I think the best way would be to take the data and put it into its own file, e.g. image/stories/chartSVG.js?

Yep, great suggestion. I've done exactly that. Thanks @kennylam !

Copy link
Member

@kennylam kennylam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @m4olivei!

Copy link
Contributor

@oliviaflory oliviaflory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @m4olivei !

@proeung proeung added Ready to merge Label for the pull requests that are ready to merge and removed Needs design approval PRs on feature requests and new components have to get design approval before merge. labels Apr 6, 2023
@kodiakhq kodiakhq bot merged commit 9155681 into carbon-design-system:main Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adopter: AEM used when component or pattern will be used by this adopter bug Something isn't working dev Needs some dev work owner: Innovation Team used when the engineering work will be done by Hybrid Cloud with DDS engineers as consultants package: web components Work necessary for the IBM.com Library web components package Ready to merge Label for the pull requests that are ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants