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

feat(dropshadow): add dropshadow foundation #2674

Open
wants to merge 1 commit into
base: spectrum-two
Choose a base branch
from

Conversation

rise-erpelding
Copy link
Collaborator

@rise-erpelding rise-erpelding commented Apr 18, 2024

Description

  • Adds Storybook documentation (including code snippets and light/dark mode swatches) for Drop Shadow under the Foundations section
    CSS-740

How and where has this been tested?

Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.

Validation steps

  • View the Storybook page for Drop Shadow and confirm that it looks accurate according to the design spec (Note that some overrides are applied to the tokens to get dark and light mode working properly on the same page, but there were no issues when applying the tokens to drop shadows i components) - I used this Slack thread with design to inform the initial content/look of the page.

Regression testing

Validate:

  1. The documentation pages for at least two other components are still loading, including:
  • The pages render correctly, are accessible, and are responsive.
  1. If components have been modified, VRTs have been run on this branch:
  • VRTs have been run and looked at.
  • Any VRT changes have been accepted (by reviewer and/or PR author), or there are no changes.

Screenshots

To-do list

  • I have updated relevant storybook stories and templates.
  • If my change impacts documentation, I have updated the documentation accordingly.
  • ✨ This pull request is ready to merge. ✨

@rise-erpelding rise-erpelding added the do not merge A flag for a branch indicating it should not be merged. label Apr 18, 2024
Copy link

changeset-bot bot commented Apr 18, 2024

⚠️ No Changeset found

Latest commit: f14f4f5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Apr 18, 2024

🚀 Deployed on https://pr-2674--spectrum-css.netlify.app

Copy link
Contributor

github-actions bot commented Apr 18, 2024

File metrics

Summary

Total size: 4.23 MB*

🎉 No changes detected in any packages

* Size determined by adding together the size of the main file for all packages in the library.
* Results are not gzipped or minified.
* An ASCII character in UTF-8 is 8 bits or 1 byte.

@pfulton pfulton force-pushed the spectrum-two branch 2 times, most recently from f3dd9ff to 9931a8e Compare April 19, 2024 18:22
@rise-erpelding rise-erpelding removed the do not merge A flag for a branch indicating it should not be merged. label Apr 23, 2024
@rise-erpelding rise-erpelding force-pushed the rise-erpelding/css-740-s2-dropshadow branch from 295b6ac to 250d5b4 Compare April 23, 2024 21:57
@rise-erpelding rise-erpelding marked this pull request as ready for review April 23, 2024 22:56
Copy link
Collaborator

@jawinn jawinn left a comment

Choose a reason for hiding this comment

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

Thanks for continuing this exploration of having drop shadows within commons, and setting up the foundations page. Along with using the new tokens.

I'm not sold on the idea of these being a placeholder class within commons, and think that we should just use the four tokens as needed within our CSS, similar to how things played out with down states. For a few reasons:

  • It seems a little excessive to import into our components for a single property.
  • It may be preferable to use filter: drop-shadow or box-shadow, depending on the situation. I think box-shadow is preferable in most cases, but as you mentioned it may clash with an existing box-shadow in some components. The filter has some downsides, such as showing the shadow around the contours of the alpha channel on a partly transparent image, which might not be wanted.
  • With commons there would be the extra generically named mod properties (e.g. --mod-drop-shadow-emphasized-default-x), instead of just having the component specific mod names (if any).

Thoughts on this @pfulton and @castastrophe ?

If we don't use commons, we can still demonstrate the use of these shadow tokens here on the foundations page. Possibly with a code block under each shadow story showing the 4 tokens in a box-shadow property.

.storybook/foundations/drop-shadow/drop-shadow.mdx Outdated Show resolved Hide resolved
.storybook/foundations/drop-shadow/drop-shadow.stories.js Outdated Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

The stories and MDX page look good!

I feel like it would be helpful for users to have a short description for each shadow type and what they're used for, if the design team could provide some language for that. Looking at the internal S2 docs for "Object styles", they had some more info but were called different things (?? -- "Container emphasized", "Elevated", and "Dragged").

@castastrophe castastrophe force-pushed the spectrum-two branch 5 times, most recently from 6dbc850 to ae7aedd Compare April 26, 2024 20:37
@rise-erpelding rise-erpelding force-pushed the rise-erpelding/css-740-s2-dropshadow branch 3 times, most recently from 123deb2 to 6a22351 Compare April 29, 2024 16:43
Copy link
Collaborator

@mdt2 mdt2 left a comment

Choose a reason for hiding this comment

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

Looking great! +1 to Josh's comment about including some additional details, maybe just a brief blurb about when these would each be used

components/commons/dropshadow.css Outdated Show resolved Hide resolved
.storybook/foundations/drop-shadow/index.css Outdated Show resolved Hide resolved
@pfulton
Copy link
Collaborator

pfulton commented May 1, 2024

Thanks for continuing this exploration of having drop shadows within commons, and setting up the foundations page. Along with using the new tokens.

I'm not sold on the idea of these being a placeholder class within commons, and think that we should just use the four tokens as needed within our CSS, similar to how things played out with down states. For a few reasons:

* It seems a little excessive to import into our components for a single property.

* It may be preferable to use `filter: drop-shadow` or `box-shadow`, depending on the situation. I think `box-shadow` is preferable in most cases, but as you mentioned it may clash with an existing `box-shadow` in some components. The filter has some downsides, such as showing the shadow around the contours of the alpha channel on a partly transparent image, which might not be wanted.

* With commons there would be the extra generically named mod properties (e.g. `--mod-drop-shadow-emphasized-default-x`), instead of just having the component specific mod names (if any).

Thoughts on this @pfulton and @castastrophe ?

If we don't use commons, we can still demonstrate the use of these shadow tokens here on the foundations page. Possibly with a code block under each shadow story showing the 4 tokens in a box-shadow property.

These are good call-outs, and thanks for raising them. I think I'm in agreement with you, @jawinn: not having them in Commons, but definitely having the code examples with some guidance ("use box-shadow when: x, y, z", "use filter for a, b, c") will go a long way for us in communicating how folks should use these.

@rise-erpelding do you think that's do-able in this PR?

@rise-erpelding rise-erpelding force-pushed the rise-erpelding/css-740-s2-dropshadow branch 5 times, most recently from 5836ca7 to 8147ad0 Compare May 2, 2024 22:55
@rise-erpelding rise-erpelding force-pushed the rise-erpelding/css-740-s2-dropshadow branch 2 times, most recently from b02ba6f to bcc73cf Compare May 7, 2024 15:12
@rise-erpelding rise-erpelding requested review from jawinn and mdt2 May 7, 2024 15:16
Copy link
Collaborator

@jawinn jawinn left a comment

Choose a reason for hiding this comment

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

Nice work. This addresses everything discussed and I think this foundations docs page is good to go.

@rise-erpelding rise-erpelding force-pushed the rise-erpelding/css-740-s2-dropshadow branch from bcc73cf to e3e2312 Compare May 8, 2024 18:10
@rise-erpelding rise-erpelding added run_vrt For use on PRs looking to kick off VRT and removed run_vrt For use on PRs looking to kick off VRT labels May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge run_vrt For use on PRs looking to kick off VRT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants