Skip to content

Conversation

aramos-adobe
Copy link
Contributor

@aramos-adobe aramos-adobe commented Aug 18, 2025

Description

Documentation audit for the swatch group component.

Related issue(s)

  • docs SWC-409

Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published.
  • I have included updated documentation if my change required it.

@aramos-adobe aramos-adobe requested a review from a team as a code owner August 18, 2025 18:13
Copy link

changeset-bot bot commented Aug 18, 2025

⚠️ No Changeset found

Latest commit: b46501a

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 Aug 18, 2025

📚 Branch Preview

🔍 Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-5699

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.

Copy link
Contributor

Tachometer results

Currently, no packages are changed by this PR...

@@ -163,16 +174,16 @@ The `selected` property is always represented as an array, and as such an applic
>
<sp-swatch color="var(--spectrum-blue-500)"></sp-swatch>
<sp-swatch color="var(--spectrum-indigo-500)"></sp-swatch>
<sp-swatch color="var(--spectrum-purple-500)" selected></sp-swatch>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh I see. I guess we had multiple selecteds on the swatches in this group to illustrate that, at least initially if it's programmatically set that way, the array can still have multiple elements even in single select mode, even though you can only actually select one swatch.

I'm on board with removing this nuance in the example. It really doesn't feel much like a feature to me. Plus the selected array switches from two elements back to just one once you select a different swatch.

<sp-swatch color="var(--spectrum-fuchsia-500)"></sp-swatch>
<sp-swatch color="var(--spectrum-magenta-500)"></sp-swatch>
</sp-swatch-group>
<div>Selected: [ ]</div>
<div>
Selected: [ "var(--spectrum-blue-500)", "var(--spectrum-purple-500)" ]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would these arrays look better with code formatting? I'm on the fence; not sure I have a huge preference either way.

Copy link
Collaborator

@marissahuysentruyt marissahuysentruyt 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. I think my biggest comment would be to add more of examples of the other modifying attributes! I listed out some ideas and left some screenshots from the CSS repo, that I think we should make sure we capture here!

```

</sp-tab-panel>
<sp-tab value="rounding">Rounding</sp-tab>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you think it is useful to show the rounding="none" option? According to the design guidelines, that's actually the preferred/default corner rounding for swatch groups. We haven't shown that anywhere in the docs, however.

Along the same lines, do you think it would be useful to show the border="none" option? I was just thinking we should show examples of all of the available values for those attributes, since it's not super clear just from the API table.

Copy link
Collaborator

@rise-erpelding rise-erpelding Aug 21, 2025

Choose a reason for hiding this comment

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

image

It's unfortunate that the import of the border/rounding/shape types doesn't seem to work properly for the API table, since we end up with just the name of the type (for instance SwatchBorder) instead of the actual values it can take.

Either way, I think the swatch docs can do a lot of the heavy lifting for showing all the different features and options for a swatch and we don't necessarily need to repeat all of that, and it might be fine to just link to swatch somewhere around here instead of describing all the options again.

What I would want to show/tell for swatch group though would include:

  • No rounding since the design docs state that that's the preference within a group
  • Something about the border but I can't remember off the top of my head what's the most relevant within a swatch group... is the preference light border? Does it depend on the swatch's color contrast?
  • The text here talks about how you can put a property on the swatch group and it overrides any properties applied to the swatch, so I think that's what I'd want to see in the code snippet(s). If we set one rounding on the swatch group, and another on the swatch, the one on the group should take precedence. If we set a size on the swatch group, and another on the swatch, the one on the group would take precedence, etc.

Copy link
Collaborator

@marissahuysentruyt marissahuysentruyt left a comment

Choose a reason for hiding this comment

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

offlinegranny-hellyeah

@Rajdeepc Rajdeepc added ready-for-merge Will auto-update until merged and removed ready-for-review labels Aug 25, 2025
Copy link
Contributor

@caseyisonit caseyisonit left a comment

Choose a reason for hiding this comment

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

love the changes and collab on this! looks great

@aramos-adobe aramos-adobe merged commit e71219c into main Aug 27, 2025
24 checks passed
@aramos-adobe aramos-adobe deleted the aramos-adobe/swatch-group-docs branch August 27, 2025 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation ready-for-merge Will auto-update until merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants