-
Notifications
You must be signed in to change notification settings - Fork 201
feat(taggroup): spectrum 2 migration #3966
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
Open
rise-erpelding
wants to merge
1
commit into
spectrum-two
Choose a base branch
from
rise-erpelding/css-1037-s2-tag-group
base: spectrum-two
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+459
−96
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
"@spectrum-css/taggroup": major | ||
--- | ||
|
||
The Spectrum 2 version of Tag Group is a major change from its Spectrum 1 counterpart. | ||
|
||
Major style changes include: | ||
|
||
- Use of new tokens and custom properties for spacing tags. The method of spacing between tags has changed. Where previously tags were spaced using tokens to represent inline and block margins on each tag, tags are now spaced by tokens representing the gaps between tags. | ||
- Rather than being a single size, Tag group now comes in t-shirt sizes: Small, medium, and large. These sizes should determine the sizes of the embedded components, but also the spacing between tags. | ||
- Tag group can now accommodate a side label. To do so, it makes use of a grid layout. | ||
- In order to match the layout in the spec, more embedded components besides Tag have been added. Field label, Help text, and Action button (quiet) components have been added to the Storybook implementation, and styles are set for these embedded components within the tag group layout. | ||
|
||
In order to support the aforementioned spacing changes, the two mod properties for margin have been removed: | ||
|
||
- `--mod-tag-group-item-margin-block` | ||
- `--mod-tag-group-item-margin-inline` | ||
|
||
Instead, please customize spacing between tags with: | ||
|
||
- `--mod-tag-group-block-tag-spacing` | ||
- `--mod-tag-group-inline-tag-spacing` | ||
|
||
These custom properties may need to be set to be double the previous margin values in order to achieve the same spacing. | ||
|
||
To support custom spacing of the embedded components, several other new mod properties have been added: | ||
|
||
- `--mod-tag-group-block-spacing-label-to-tags` | ||
- `--mod-tag-group-inline-spacing-label-to-tags` | ||
- `--mod-tag-group-spacing-help-text-to-tags` |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,39 @@ | ||
{ | ||
"sourceFile": "index.css", | ||
"selectors": [".spectrum-TagGroup", ".spectrum-TagGroup-item"], | ||
"selectors": [ | ||
".spectrum-TagGroup", | ||
".spectrum-TagGroup--sideLabel", | ||
".spectrum-TagGroup--sideLabel .spectrum-TagGroup-actionButton", | ||
".spectrum-TagGroup--sideLabel .spectrum-TagGroup-helpText", | ||
".spectrum-TagGroup--sideLabel .spectrum-TagGroup-label", | ||
".spectrum-TagGroup--sideLabel .spectrum-TagGroup-tags", | ||
".spectrum-TagGroup--sizeL", | ||
".spectrum-TagGroup--sizeS", | ||
".spectrum-TagGroup-actionButton", | ||
".spectrum-TagGroup-helpText", | ||
".spectrum-TagGroup-label", | ||
".spectrum-TagGroup-tags" | ||
], | ||
"modifiers": [ | ||
"--mod-tag-group-item-margin-block", | ||
"--mod-tag-group-item-margin-inline" | ||
"--mod-tag-group-block-spacing-label-to-tags", | ||
"--mod-tag-group-block-tag-spacing", | ||
"--mod-tag-group-inline-spacing-label-to-tags", | ||
"--mod-tag-group-inline-tag-spacing", | ||
"--mod-tag-group-spacing-help-text-to-tags" | ||
], | ||
"component": [ | ||
"--spectrum-tag-group-item-margin-block", | ||
"--spectrum-tag-group-item-margin-inline" | ||
"--spectrum-tag-group-block-spacing-label-to-tags", | ||
"--spectrum-tag-group-block-tag-spacing", | ||
"--spectrum-tag-group-inline-spacing-label-to-tags", | ||
"--spectrum-tag-group-inline-tag-spacing", | ||
"--spectrum-tag-group-spacing-help-text-to-tags" | ||
], | ||
"global": [ | ||
"--spectrum-field-label-to-component", | ||
"--spectrum-help-text-to-component", | ||
"--spectrum-spacing-100", | ||
"--spectrum-spacing-200" | ||
], | ||
"global": ["--spectrum-spacing-75"], | ||
"passthroughs": [], | ||
"high-contrast": [] | ||
} |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/*! | ||
* Copyright 2024 Adobe. All rights reserved. | ||
* Copyright 2025 Adobe. All rights reserved. | ||
* | ||
* This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. You may obtain a copy | ||
|
@@ -12,17 +12,71 @@ | |
*/ | ||
|
||
.spectrum-TagGroup { | ||
--spectrum-tag-group-item-margin-block: var(--spectrum-spacing-75); | ||
--spectrum-tag-group-item-margin-inline: var(--spectrum-spacing-75); | ||
--spectrum-tag-group-inline-tag-spacing: var(--spectrum-spacing-200); | ||
--spectrum-tag-group-block-tag-spacing: var(--spectrum-spacing-200); | ||
--spectrum-tag-group-block-spacing-label-to-tags: var(--spectrum-field-label-to-component); | ||
--spectrum-tag-group-inline-spacing-label-to-tags: var(--spectrum-spacing-200); | ||
--spectrum-tag-group-spacing-help-text-to-tags: var(--spectrum-help-text-to-component); | ||
} | ||
|
||
.spectrum-TagGroup--sizeS { | ||
--spectrum-tag-group-inline-tag-spacing: var(--spectrum-spacing-100); | ||
--spectrum-tag-group-block-tag-spacing: var(--spectrum-spacing-100); | ||
} | ||
|
||
.spectrum-TagGroup--sizeL { | ||
--spectrum-tag-group-inline-tag-spacing: var(--spectrum-spacing-200); | ||
--spectrum-tag-group-block-tag-spacing: var(--spectrum-spacing-200); | ||
} | ||
Comment on lines
+27
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We may not even really need this selector, since it's exactly the same values as the medium tag group. I can, however, see an argument for keeping it anyways, just to make it clear where the large styles live. It follows our preferred t-shirt sizing pattern regardless. |
||
|
||
.spectrum-TagGroup { | ||
display: grid; | ||
grid-template-rows: auto auto auto auto; | ||
} | ||
|
||
.spectrum-TagGroup-tags { | ||
display: inline-flex; | ||
flex-wrap: wrap; | ||
margin: 0; | ||
padding: 0; | ||
list-style: none; | ||
column-gap: var(--mod-tag-group-inline-tag-spacing, var(--spectrum-tag-group-inline-tag-spacing)); | ||
row-gap: var(--mod-tag-group-block-tag-spacing, var(--spectrum-tag-group-block-tag-spacing)); | ||
margin-block-end: var(--mod-tag-group-block-tag-spacing, var(--spectrum-tag-group-block-tag-spacing)); | ||
} | ||
|
||
.spectrum-TagGroup-label { | ||
margin-block-end: var(--mod-tag-group-block-spacing-label-to-tags, var(--spectrum-tag-group-block-spacing-label-to-tags)); | ||
} | ||
|
||
.spectrum-TagGroup-actionButton { | ||
justify-self: start; | ||
} | ||
|
||
.spectrum-TagGroup-helpText { | ||
margin-block-start: var(--mod-tag-group-spacing-help-text-to-tags, var(--spectrum-tag-group-spacing-help-text-to-tags)); | ||
} | ||
|
||
.spectrum-TagGroup-item { | ||
margin-block: var(--mod-tag-group-item-margin-block, var(--spectrum-tag-group-item-margin-block)); | ||
margin-inline: var(--mod-tag-group-item-margin-inline, var(--spectrum-tag-group-item-margin-inline)); | ||
.spectrum-TagGroup--sideLabel { | ||
grid-template-columns: auto auto; | ||
grid-template-rows: auto auto auto; | ||
|
||
.spectrum-TagGroup-label { | ||
grid-row: 1; | ||
grid-column: 1; | ||
margin-block-end: 0; | ||
margin-inline-end: var(--mod-tag-group-inline-spacing-label-to-tags, var(--spectrum-tag-group-inline-spacing-label-to-tags)); | ||
} | ||
|
||
.spectrum-TagGroup-tags { | ||
grid-row: 1; | ||
grid-column: 2; | ||
} | ||
|
||
.spectrum-TagGroup-actionButton { | ||
grid-row: 2; | ||
grid-column: 2; | ||
} | ||
|
||
.spectrum-TagGroup-helpText { | ||
grid-row: 3; | ||
grid-column: 2; | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the voice you took in the changeset, like instructing what someone would need to do to migrate to this version. I might steal that 😊