-
Notifications
You must be signed in to change notification settings - Fork 201
fix(modal): change modal background color to transparent #3604
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
Merged
marissahuysentruyt
merged 4 commits into
spectrum-two
from
marissahuysentruyt/css-1057-transparent-modal-background
Mar 11, 2025
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
65ae653
refactor(modal): update modal background color to transparent
marissahuysentruyt 455b990
docs(dialog): remove custom modal style
marissahuysentruyt a69dc5f
chore(modal): create changeset
marissahuysentruyt 7c3f7e0
chore: rebase and update metadata.json
marissahuysentruyt 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,5 @@ | ||
--- | ||
"@spectrum-css/modal": patch | ||
--- | ||
|
||
In Spectrum 2, elements that would typically be children of a modal (like dialogs, alert dialogs, and tray) have background-color token specs defined. Because modal _also_ had a defined background color, there was some antialiasing bleed-through happening on the corners, since both the modal and its child now had background colors on top of each other. `--spectrum-modal-background-color` is now redefined as `transparent` to avoid these conflicts in S2. `--mod-modal-background-color` is still available to consumers. |
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
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 |
---|---|---|
|
@@ -16,10 +16,6 @@ export const DialogGroup = Variants({ | |
// TODO: The dialog's heading arg is getting passed as the "Sizing" heading arg (instead of the | ||
// TODO: word "Sizing"). We should be able to remove this arg once that no longers happens. | ||
heading: showTestingGrid ? "Lorem ipsum dolor sit amet, consectetur adipiscing elit" : args.heading, | ||
customStyles: { | ||
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. Dialog has a defined background color, so these custom background colors are no longer needed. |
||
...(args.customStyles ?? {}), | ||
"background-color": showTestingGrid ? "var(--spectrum-gray-100)" : undefined, | ||
}, | ||
}, context); | ||
}, | ||
sizeDirection: "column", | ||
|
@@ -66,7 +62,6 @@ export const DialogFullscreen = Variants({ | |
*/ | ||
customStyles: { | ||
margin: showTestingGrid ? "16px" : undefined, | ||
"background-color": showTestingGrid ? "var(--spectrum-gray-100)" : undefined, | ||
}, | ||
}, context); | ||
}, | ||
|
@@ -85,9 +80,6 @@ export const DialogFullscreen = Variants({ | |
export const DialogFullscreenTakeover = Variants({ | ||
Template, | ||
withSizes: false, | ||
wrapperStyles: { | ||
"background-color": "var(--spectrum-gray-50)" | ||
}, | ||
testData: [ | ||
{ | ||
showModal: false, | ||
|
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
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
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
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 |
---|---|---|
|
@@ -57,6 +57,9 @@ export default { | |
], | ||
}; | ||
|
||
/** | ||
* The default modal does not include a background color itself, other than `transparent`. If implementations are in need of a background color, and one is not supported within the modal's child component (for example, the dialog defines its own background color), `--mod-modal-background-color` may be set on the `.spectrum-Modal` class. | ||
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. I'm open to suggestions on how to describe this. |
||
*/ | ||
export const Default = ModalGroup.bind({}); | ||
Default.args = { | ||
content: [ | ||
|
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
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.
An extra
isOpen
must have been brought over by mistake during a rebase or something.