You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR addresses APIs misunderstandings regarding the sp-card component's slots. Previously used slots preview and cover-photo are now merged into a single one named image. The styles are applied exactly as before, based on the variant and horizontal properties, through using the according id that maps to spectrum CSS styles.
Also, now the quiet variant is included in the style overrides, and a new --mod-* CSS variable was added to allow consumers to reliably obtain the desired behaviour (the added story reflects the usage of this token).
Some CSS was also changed to remove deprecated overrides and improve readability.
Related issue(s)
N/A
Motivation and context
The component public API states that the cover-photo slot should be used with the quiet variant. The consumer should not need to determine which slot to use with each variant.
SWC's code examples use preview with the quiet variant
The component, while placing the user in a position to make the correct decision about what slot to use with a specific variant, allows for both slots to be used at the same time but doesn't display the cover-photo anyway
Looks like the quiet variant was included in the width: 100% at a previous point in time but the change to not include it anymore wasn't documented too much. There is a need to come back to the previous behaviour (to include the quiet variant in the full width CSS). It seems like a --mod-* is the best common ground to allow consumers all behaviours related to using an image and how to position it inside the asset, be that cover, contain, scale-down etc. (discussion context)
How has this been tested?
No functional changes were added. All the slots usage in the project have been updated. This being said, all unit tests should pass and VRTs should show changes only for the quiet variant's initial width. A new story was added to reflect the usage of the newly added token.
Screenshots (if appropriate)
Types of changes
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Breaking change (fix or feature that would cause existing functionality to change)
Chore (minor updates related to the tooling or maintenance of the repository, does not impact compiled assets)
If my change required a change to the documentation, I have updated the documentation in this pull request.
I have read the CONTRIBUTING document.
I have added tests to cover my changes.
All new and existing tests passed.
I have reviewed at the Accessibility Practices for this feature, see: Aria Practices
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against main.
If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.
Lighthouse scores comparing the documentation site built from the PR ("Branch") to that of the production documentation site ("Latest") and the build currently on main ("Main"). Higher scores are better, but note that the SEO scores on Netlify URLs are artifically constrained to 0.92.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses APIs misunderstandings regarding the
sp-card
component's slots. Previously used slotspreview
andcover-photo
are now merged into a single one namedimage
. The styles are applied exactly as before, based on thevariant
andhorizontal
properties, through using the according id that maps to spectrum CSS styles.Also, now the
quiet
variant is included in the style overrides, and a new--mod-*
CSS variable was added to allow consumers to reliably obtain the desired behaviour (the added story reflects the usage of this token).Some CSS was also changed to remove deprecated overrides and improve readability.
Related issue(s)
Motivation and context
cover-photo
slot should be used with thequiet
variant. The consumer should not need to determine which slot to use with each variant.preview
with thequiet
variantpreview
with thequiet
variantquiet
variant was included in thewidth: 100%
at a previous point in time but the change to not include it anymore wasn't documented too much. There is a need to come back to the previous behaviour (to include thequiet
variant in the full width CSS). It seems like a--mod-*
is the best common ground to allow consumers all behaviours related to using an image and how to position it inside the asset, be that cover, contain, scale-down etc. (discussion context)How has this been tested?
No functional changes were added. All the slots usage in the project have been updated. This being said, all unit tests should pass and VRTs should show changes only for the quiet variant's initial width. A new story was added to reflect the usage of the newly added token.
Screenshots (if appropriate)
Types of changes
Checklist
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against
main
.