Файли
openidea/src/ui/Dialog.module.css
T
l0ng-ai f70f362a3d feat(ui): open New Project, Get from VCS and Remote Development in their own windows (#6208)
* feat(ui): open New Project, Get from VCS and Remote Development in their own windows

Each dialog gets a native window over its project window: a full-height
sidebar under the traffic lights, the title heading the content and the
buttons in its corner. The windows hand their result back to the project
window, which opens the created or cloned project or makes the remote
connection and reports its progress. Remote windows and the browser build
keep the dialogs in the page.

* feat(ui): show dialogs in the page as sheets without window buttons on macOS

The title heads the content instead of a title bar with drawn traffic
lights; Esc and Cancel close the dialog, and the title dims while the
window is inactive.

* fix(ui): give a macOS dialog without footer buttons a Close button

A sheet has no window buttons, so a dialog with neither buttons nor a
footer could only be closed with Esc. The Extract Interface members
table may shrink to two rows so the dialog still fits a short window
under the taller sheet title.
2026-11-27 08:59:33 +08:00

268 рядки
5.4 KiB
CSS

/* Modal layer: blocks the workbench but never dims it (IDEA dialogs are separate windows). */
.backdrop {
position: fixed;
inset: 0;
z-index: var(--z-dialog);
display: flex;
align-items: center;
justify-content: center;
padding: 24px;
background: transparent;
}
.top {
align-items: flex-start;
padding-top: 10vh;
}
/* macOS draws its window buttons over the page; keep dialogs out of that band. */
.belowTitleBar {
padding-top: max(24px, var(--h-titlebar));
}
.belowTitleBar.top {
padding-top: max(10vh, var(--h-titlebar));
}
.dialog {
display: flex;
flex-direction: column;
position: relative;
max-width: 100%;
max-height: 100%;
background: var(--bg-dialog, var(--bg-elev));
color: var(--fg-strong);
outline: none;
overflow: hidden;
animation: rise var(--dur) var(--ease);
}
/* macOS / Windows window: 10px corners, hairline frame, large soft window shadow. */
.window {
border-radius: var(--radius-dialog);
border: 1px solid var(--border-dialog, var(--border-popup));
box-shadow: var(--shadow-dialog);
}
.popup {
border-radius: var(--radius-popup-large);
border: 1px solid var(--border-popup);
box-shadow: var(--shadow-popup);
}
/* Corner grip for `resizable` dialogs (over the footer's right padding). */
.resizeGrip {
position: absolute;
right: 0;
bottom: 0;
width: 16px;
height: 16px;
cursor: nwse-resize;
touch-action: none;
background: linear-gradient(
135deg,
transparent 55%,
var(--fg-faint) 55%,
var(--fg-faint) 62%,
transparent 62%,
transparent 72%,
var(--fg-faint) 72%,
var(--fg-faint) 79%,
transparent 79%
);
opacity: 0.55;
}
.resizeGrip:hover {
opacity: 1;
}
/* Title bar (drag handle). macOS: traffic lights then the title; else title + close. */
.titleBar {
height: var(--h-dialog-titlebar, 32px);
flex: none;
display: flex;
align-items: center;
gap: var(--space-2);
padding: 0 6px 0 14px;
cursor: default;
user-select: none;
touch-action: none;
}
.macTitleBar {
height: var(--h-dialog-titlebar-mac, 40px);
padding: 0 var(--space-4);
}
.popupHeader {
height: 32px;
flex: none;
display: flex;
align-items: center;
gap: var(--space-2);
padding: 0 14px;
}
.title {
flex: 1;
min-width: 0;
color: var(--fg-strong);
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.macTitleBar .title {
font-size: var(--fs-ui);
}
/* An inactive window's title dims, as AppKit's does. */
[data-inactive] .macTitleBar .title {
color: var(--fg-muted);
}
.body {
flex: 1;
min-height: 0;
overflow: auto;
}
.body::-webkit-scrollbar {
width: 10px;
height: 10px;
}
.body::-webkit-scrollbar-thumb {
background-color: var(--scrollbar-thumb);
border: 2px solid transparent;
border-radius: 5px;
background-clip: content-box;
}
.body::-webkit-scrollbar-track,
.body::-webkit-scrollbar-corner {
background: transparent;
}
/* [?] [footerStart …] [buttons, platform order]; buttons wrap below a footerStart that does not fit. */
.footer {
flex: none;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: flex-end;
gap: var(--space-3);
padding: 12px 16px;
}
/* macOS: the buttons sit in the content's corner, as in the dialog windows. */
[data-platform="mac"] > .footer:not(.messageFooter) {
padding-bottom: var(--space-4);
}
.footerStart {
flex: 1 1 0;
min-width: fit-content;
max-width: 100%;
display: flex;
align-items: center;
gap: var(--space-3);
}
.buttons {
flex: 0 1 auto;
min-width: 0;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: flex-end;
gap: var(--space-3);
margin-left: auto;
}
/* macOS round help button. */
.help {
flex: none;
width: 22px;
height: 22px;
padding: 0;
border-radius: 50%;
background: var(--bg-button);
color: var(--fg-strong);
box-shadow: inset 0 0 0 1px var(--border-button);
font-size: var(--fs-ui);
font-weight: 600;
line-height: 1;
}
.help:hover {
background: color-mix(in srgb, var(--bg-button) 94%, var(--fg-strong));
}
.help:focus-visible {
outline: 2px solid var(--focus-ring);
outline-offset: 1px;
}
/* Messages alert (IDEA AlertDialog): 32px icon, bold title, text; draggable anywhere but controls. */
.message {
flex: 1;
min-height: 0;
overflow: auto;
display: flex;
gap: var(--space-4);
padding: 20px 24px 4px 20px;
cursor: default;
touch-action: none;
}
.messageIcon {
flex: none;
}
.messageAppIcon {
flex: none;
width: 64px;
height: 64px;
}
.messageShape {
fill: var(--message-icon-color);
}
.messageGlyph {
stroke: var(--fg-button-primary);
}
.question,
.info {
--message-icon-color: var(--info);
}
.warning {
--message-icon-color: var(--warning);
}
.error {
--message-icon-color: var(--danger);
}
.messageText {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: var(--space-2);
padding-top: 4px;
}
.messageTitle {
color: var(--fg-strong);
font-weight: 600;
}
.messageBody {
color: var(--fg-strong);
line-height: 1.5;
overflow-wrap: anywhere;
white-space: pre-line;
}
.messageExtra {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: var(--space-2);
margin-top: 8px;
}
.messageFooter {
padding: 16px 24px 20px;
}
@keyframes rise {
from {
opacity: 0;
transform: translateY(4px) scale(0.995);
}
}
@media (prefers-reduced-motion: reduce) {
.dialog {
animation: none;
}
}
@media (forced-colors: active) {
.dialog {
border: 1px solid CanvasText;
}
}