-
Notifications
You must be signed in to change notification settings - Fork 235
feat: migrate asset to s2 styles and second-gen architecture #5858
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
base: main
Are you sure you want to change the base?
Changes from all commits
58474d7
b5ba2d3
1b8d3f0
a3ae158
527b0fc
9b12ba6
9dd81b4
3c3f03e
7253110
6ee03cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| /** | ||
| * 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 | ||
| * of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software distributed under | ||
| * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
| * OF ANY KIND, either express or implied. See the License for the specific language | ||
| * governing permissions and limitations under the License. | ||
| */ | ||
|
|
||
| export const ASSET_VARIANTS = ['file', 'folder'] as const; | ||
|
|
||
| export type AssetVariant = (typeof ASSET_VARIANTS)[number]; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,9 @@ | ||
| /** | ||
| /*! | ||
| * 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 | ||
| * of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
| * of the License at <http://www.apache.org/licenses/LICENSE-2.0> | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software distributed under | ||
| * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
|
|
@@ -11,81 +12,42 @@ | |
| */ | ||
|
|
||
| :host { | ||
| --spectrum-asset-folder-background: var( | ||
| --highcontrast-asset-icon-background-color, | ||
| var( | ||
| --mod-asset-folder-background-color, | ||
| var(--spectrum-asset-folder-background-color) | ||
| ) | ||
| ); | ||
| --spectrum-asset-file-background: var( | ||
| --highcontrast-asset-icon-background-color, | ||
| var( | ||
| --mod-asset-file-background-color, | ||
| var(--spectrum-asset-file-background-color) | ||
| ) | ||
| ); | ||
| --spectrum-asset-folder-outline: var( | ||
| --mod-asset-icon-outline-color, | ||
| var(--spectrum-asset-icon-outline-color) | ||
| ); | ||
| --spectrum-asset-file-outline: var( | ||
| --mod-asset-icon-outline-color, | ||
| var(--spectrum-asset-icon-outline-color) | ||
| ); | ||
| display: flex; | ||
| } | ||
|
|
||
| .spectrum-Asset { | ||
TarunAdobe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| inline-size: 100%; | ||
| block-size: 100%; | ||
| justify-content: center; | ||
| align-items: center; | ||
| display: flex; | ||
|
|
||
| --spectrum-asset-folder-background-color: var( | ||
| --system-asset-folder-background-color | ||
| ); | ||
| --spectrum-asset-file-background-color: var( | ||
| --system-asset-file-background-color | ||
| ); | ||
| --spectrum-asset-icon-outline-color: var(--system-asset-icon-outline-color); | ||
| } | ||
|
|
||
| ::slotted(*) { | ||
| .spectrum-Asset-image { | ||
|
Contributor
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. This is a breaking change for the existing behaviour if consumers are slotting an ::slotted() { /* same rules */ }
.spectrum-Asset-image { /* same rules */ }
Contributor
Author
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. but can we not break this for spectrum-two?
Contributor
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 should try not to treat S2 as a chance to introduce breaking changes unless they’re really necessary. These can have a big impact on adoption for product teams, so it’s worth being mindful about when and why we make them. If a change truly adds more value than the potential disruption, we can definitely go for it |
||
| max-inline-size: 100%; | ||
| max-block-size: 100%; | ||
| object-fit: contain; | ||
| transition: opacity var(--spectrum-animation-duration-100); | ||
| } | ||
|
|
||
| .file, | ||
| .folder { | ||
| inline-size: max(48px, min(100%, 80px)); | ||
| inline-size: max( | ||
| var(--mod-asset-icon-min-width, 48px), | ||
| min(100%, var(--mod-asset-icon-max-width, 80px)) | ||
| ); | ||
| .spectrum-Asset-folder, | ||
| .spectrum-Asset-file { | ||
| inline-size: clamp(48px, 100%, 80px); | ||
| block-size: 100%; | ||
| margin: 20px; | ||
| margin: var(--mod-asset-icon-margin, 20px); | ||
| } | ||
|
|
||
| .folderBackground { | ||
| fill: var(--spectrum-asset-folder-background); | ||
| } | ||
|
|
||
| .fileBackground { | ||
| fill: var(--spectrum-asset-file-background); | ||
| .spectrum-Asset-folderBackground { | ||
| fill: var(--spectrum-gray-200); | ||
|
Contributor
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. Do these map to the same value? Can you surface up these changes in the PR documentation too for quick reference by reviewers. Its hard to visualize from here
Collaborator
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. These should be the same values, yes (and they look to be mapped correctly). Before Cassondra left, she started removing some of the complexity from a chunk of components, asset being one of them. You can see the changes (and remove of the In a different PR (that does the same and removes mods and some of the Hopefully that's useful! I absolutely agree with @Rajdeepc that we should surface the changes in a changeset. None of these migrations have had a changeset yet. (I asked a similar question in Slack when I was working on status light). Do we have the changeset management situation figured out? I've been out, so it might be and we need a changeset! |
||
| } | ||
|
|
||
| .folderOutline { | ||
| fill: var(--spectrum-asset-folder-outline); | ||
| .spectrum-Asset-fileBackground { | ||
| fill: var(--spectrum-gray-25); | ||
| } | ||
|
|
||
| .fileOutline { | ||
| fill: var(--spectrum-asset-file-outline); | ||
| .spectrum-Asset-folderOutline { | ||
| fill: var(--spectrum-gray-500); | ||
| } | ||
|
|
||
| @media (forced-colors: active) { | ||
| :host { | ||
| --highcontrast-asset-icon-background-color: currentcolor; | ||
| } | ||
| .spectrum-Asset-fileOutline { | ||
| fill: var(--spectrum-gray-500); | ||
| } | ||
TarunAdobe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Uh oh!
There was an error while loading. Please reload this page.