UNPKG

@openui5/sap.m

Version:

OpenUI5 UI Library sap.m

491 lines (394 loc) 11.8 kB
/* ============================= */ /* CSS for control sap.m/Dialog */ /* Base theme */ /* ============================= */ @_sap_m_Dialog_VerticalMargin: 3.5%; @_sap_m_Dialog_BarHeight: 3rem; @_sap_m_Dialog_BarCompactHeight: 2.5rem; @_sap_m_Dialog_SubHeaderHeight: 3rem; @_sap_m_Dialog_SubHeaderCompactHeight: 2rem; @_sap_m_Dialog_InfoDesignBarHeight: 2rem; @_sap_m_Dialog_Padding: 1rem; @_sap_m_Dialog_NoStateHeaderShadow: inset 0 -0.0625rem var(--sapPageHeader_BorderColor); @_sap_m_Dialog_SuccessHeaderShadow: inset 0 -0.125rem var(--sapSuccessBorderColor); @_sap_m_Dialog_ErrorHeaderShadow: inset 0 -0.125rem var(--sapErrorBorderColor); @_sap_m_Dialog_WarningHeaderShadow: inset 0 -0.125rem var(--sapWarningBorderColor); @_sap_m_Dialog_InformationHeaderShadow: inset 0 -0.125rem var(--sapInformationBorderColor); @_sap_m_Dialog_HeaderFocusBorderRadius: 0px; @_sap_m_Dialog_HeaderFocusBorderBottomOffset: 3px; @_sap_m_Dialog_HeaderFocusBorderTopOffset: 2px; @_sap_m_Dialog_HeaderFocusBorderLeftOffset: 2px; @_sap_m_Dialog_HeaderFocusBorderRightOffset: 2px; @_sap_m_Dialog_FocusOutlineOffset: 0.0625rem; @_sap_m_Dialog_ResizableBottomRightRadius: 1.75rem; .sapMDialog, .sapMMessageDialog .sapMDialogScrollCont, .sapMDialogSection { box-sizing: border-box; } .sapMDialog { /* scale(1) - Chrome does not clip children when transform is not applied resulting in non-visible border-radius */ /* translateZ(0px) - Safari Problem with z-index - After dialog was opened it was inserted behind the dark overlay */ -webkit-transform: scale(1) translateZ(0px); background-clip: padding-box; min-height: 6rem; outline: none; position: fixed !important; display: flex !important; flex-direction: column; opacity: 0; transition: opacity 0.15s; border-radius: var(--sapElement_BorderCornerRadius); padding-inline: 0; &:not(.sapMDialogHighPixelDensity) { /* prevent blurring when the device pixel ration is 1 (not high density screens) */ /* this is done with style and not with media query for wider support */ filter: blur(0); } } .sapMDialog, .sapMDialog.sapUiShd /* Web Components Integration */ { box-shadow: var(--sapContent_Shadow3); } .sapMDialog > .sapMDialogSection { max-width: 100%; background: var(--sapGroup_ContentBackground); } .sapMDialog .sapMDialogScrollCont > * { vertical-align: middle; } .sapMDialog.sapMDialogStretched { bottom: 0 !important; right: 0 !important; height: auto !important; /* this is for preventing inline size/width sizes set the width */ width: auto !important; /* this is for preventing inline size/height sizes set the height */ min-width: 0 !important; /* this is for preventing the dialog to hold it's width in small screens */ min-height: 0 !important; /* this is for preventing the dialog to hold it's width in small screens */ } /* Removing borders, shadow, and rounded corners when the dialog is on fullscreen */ html.sap-phone .sapMDialog.sapMDialogStretched { border: none; box-shadow: none; border-radius: 0; } html:not(.sap-phone) .sapMDialog { header .sapMHeader-CTX { border-radius: var(--sapElement_BorderCornerRadius) var(--sapElement_BorderCornerRadius) 0 0; } &.sapMDialog-NoHeader header .sapMSubHeader-CTX { border-radius: var(--sapElement_BorderCornerRadius) var(--sapElement_BorderCornerRadius) 0 0; } &.sapMDialog-NoHeader:not(.sapMDialogWithSubHeader) .sapMDialogSection { border-top-right-radius: var(--sapElement_BorderCornerRadius); border-top-left-radius: var(--sapElement_BorderCornerRadius); } footer .sapMFooter-CTX { border-radius: 0 0 var(--sapElement_BorderCornerRadius) var(--sapElement_BorderCornerRadius); } &.sapMDialog-NoFooter .sapMDialogSection { border-bottom-right-radius: var(--sapElement_BorderCornerRadius); border-bottom-left-radius: var(--sapElement_BorderCornerRadius); } } html.sap-phone .sapMDialog { min-width: 18rem; overflow: hidden; & > footer .sapMFooter-CTX { display: flex; padding: 0 0.25rem; } } html.sap-tablet .sapMDialog, html.sap-desktop .sapMDialog { min-width: 20rem; } .sapMDialog .sapMIBar { position: relative; width: auto; } .sapMDialog .sapMDialogSection { overflow: hidden; position: relative; &:focus { outline: var(--sapContent_FocusWidth) var(--sapContent_FocusStyle) var(--sapContent_FocusColor); outline-offset: ~"calc(-1 * var(--sapContent_FocusWidth))"; } } .sapMDialogScroll { display: inline-block; /* this is for horizontal scrolling enablement */ height: auto; width: 100%; vertical-align: middle; box-sizing: border-box; } .sapMDialog.sapMDialogVerticalScrollIncluded { .sapMDialogScroll { width: auto; } html[data-sap-ui-browser^='sf'] & .sapMDialogSection { /* For Safari - allow the vertical scroll bar to overlap the right padding which we use to compensate for its width. This happens by default for other browsers. */ overflow-y: overlay !important; padding-right: 0px !important; } } /* disable scrolling automatically for sap.m.Page sap.m.NavContainer sap.m.ScrollingContainer inside Dialog */ .sapMDialogVerScrollDisabled .sapMDialogScroll { height: 100%; } /* disable scrolling automatically for sap.m.Page sap.m.NavContainer sap.m.ScrollingContainer inside Dialog */ .sapMDialogHorScrollDisabled .sapMDialogScroll { display: block; /* This div has position set to absolute when runs in android native browser with version less than 4.1. */ /* Width needs to be set to 100% due to position absolute */ width: 100%; } .sapMDialogHidden { /* display: none; */ /* visibility need to be used instead of display none, because some control inside dialog may need to do calculation */ visibility: hidden; } .sapMDialog.sapUiPopupWithPadding:not(.sapUiNoContentPadding) { .sapMDialogScrollCont { padding: @_sap_m_Dialog_Padding; &.sapMDialogStretchContent { height: calc(~"100% - 2 * " @_sap_m_Dialog_Padding); } } } .sapMDialogScrollCont.sapMDialogStretchContent { height: 100%; } /* messagedialog always has content padding */ .sapMMessageDialog .sapMDialogScrollCont { box-sizing: border-box; padding: 1rem; } .sapMActionSheetDialog .sapMDialogScrollCont { padding: 0; /* no content padding for action sheet */ } .sapMDialogOpen { opacity: 1; } /* mixin call for creating container content padding classes (arguments: rootContainer, contentSelector) */ .sapUiContainerContentPadding(~".sapMDialog", ~"> section > .sapMDialogScroll > .sapMDialogScrollCont"); /* ====================================================== */ .sapMDialog.sapMMessageDialog { font-size: 0.875rem; } .sapMDialog > header .sapMDialogTitleGroup, .sapMDialog > header .sapMDialogSubHeader { font-size: 1rem; } .sapMDialog:not(.sapMDialogWithSubHeader) .sapMDialogSubHeader { display: none; } .sapMDialogIcon ~ .sapMDialogTitle { display: inline; } /* remove the branding color of bar in page when page is in dialog*/ .sapMDialog .sapMIBar.sapMPageHeader::before { border-top: none; } .sapMMessageDialog.sapMPopup-CTX > header .sapMDialogTitleGroup { background-image: none; filter: none; } .sapMDialog > header .sapMDialogTitleGroup .sapMTitle { color: var(--sapPageHeader_TextColor); vertical-align: middle; } .sapMDialog > header .sapMDialogTitleGroup .sapMImg { height: 2.25rem; margin-right: 0.625rem; vertical-align: middle; width: 2.25rem; } .sapMDialog > header .sapMDialogTitleGroup .sapMDialogIcon.sapUiIcon { font-size: 1.25rem; vertical-align: middle; } .sapMTB.sapMTBNoBorders { border-bottom: none; } /* Compact size */ .sapUiSizeCompact { &.sapMDialog, .sapMDialog { min-height: @_sap_m_Dialog_BarCompactHeight; padding-bottom: @_sap_m_Dialog_BarCompactHeight; &.sapMDialogWithSubHeader { &.sapMDialog-NoHeader { & .sapMDialogSubHeader { top: 0; } } } .sapMDialogTitleGroup { min-height: @_sap_m_Dialog_BarCompactHeight; .sapMHeader-CTX, .sapMSubHeader-CTX { height: @_sap_m_Dialog_BarCompactHeight; padding-top: 0.25rem; padding-bottom: 0.25rem; box-sizing: border-box; } } & > .sapMDialogSection { min-height: @_sap_m_Dialog_BarCompactHeight; } & > footer { height: @_sap_m_Dialog_BarCompactHeight; .sapMFooter-CTX { height: @_sap_m_Dialog_BarCompactHeight; } } .sapMDialogSubHeader { height: @_sap_m_Dialog_SubHeaderCompactHeight; top: @_sap_m_Dialog_BarCompactHeight; } } } .sapMDialogDisableSelection { -webkit-user-select: none; user-select: none; } .sapMDialogResizeHandle { position: absolute; right: -0.5rem; bottom: -0.5rem; width: 1.5rem; height: 1.5rem; z-index: 2; line-height: 1rem; cursor: se-resize; border-radius: 50%; .sapMDialogResizeHandleIcon { position: relative; left: 0; top: 0; width: 1rem; height: 1rem; color: var(--sapButton_Lite_TextColor); cursor: inherit; } } .sapMDialog { box-sizing: content-box; min-height: @_sap_m_Dialog_BarHeight; padding-bottom: @_sap_m_Dialog_BarHeight; footer { .sapMTB.sapMFooter-CTX { border-bottom: none; } } &.sapMDialog-NoFooter { padding-bottom: 0; } &.sapMDialogWithSubHeader { &.sapMDialogSubHeaderInfoBar { .sapMDialogSubHeader { height: @_sap_m_Dialog_InfoDesignBarHeight; } } &.sapMDialog-NoHeader { .sapMDialogSubHeader { top: 0; } } } .sapMDialogTitleGroup { min-height: @_sap_m_Dialog_BarHeight; left: 0; position: absolute; right: 0; top: 0; } &:has(.sapMDialogDragAndResizeHandler:focus) { &::before { content: ''; position: absolute; inset: @_sap_m_Dialog_FocusOutlineOffset; border: var(--sapContent_FocusWidth) var(--sapContent_FocusStyle) var(--sapContent_FocusColor); border-radius: var(--sapElement_BorderCornerRadius); pointer-events: none; z-index: 5; // CodeEditor is 4 } &.sapMDialogResizable::before { border-radius: var(--sapElement_BorderCornerRadius) var(--sapElement_BorderCornerRadius) @_sap_m_Dialog_ResizableBottomRightRadius var(--sapElement_BorderCornerRadius); } } & > .sapMDialogSection { flex: 1 1 100%; min-height: @_sap_m_Dialog_BarHeight; } & > footer { bottom: 0; height: @_sap_m_Dialog_BarHeight; left: 0; position: absolute; right: 0; } &.sapMDialogDraggable > header { cursor: move; } .sapMDialogSubHeader { cursor: default; height: @_sap_m_Dialog_SubHeaderHeight; left: 0; position: absolute; right: 0; top: @_sap_m_Dialog_BarHeight; z-index: 2; } } /* remove transition when animation is off */ html[data-sap-ui-animation='off'] .sapMDialog { transition: none; } .sapMDialog.sapMDialogWithSubHeader .sapMDialogTitleGroup .sapMIBar { box-shadow: none; } .sapMDialog > header:last-of-type .sapMIBar { box-shadow: @_sap_m_Dialog_NoStateHeaderShadow; } .sapMDialogWarning > header { .sapMDialogTitleGroup .sapMDialogIcon.sapUiIcon { color: var(--sapCriticalElementColor); } & > div:last-of-type .sapMIBar { box-shadow: @_sap_m_Dialog_WarningHeaderShadow; } } .sapMDialogError > header { .sapMDialogTitleGroup .sapMDialogIcon.sapUiIcon { color: var(--sapNegativeElementColor); } & > div:last-of-type .sapMIBar { box-shadow: @_sap_m_Dialog_ErrorHeaderShadow; } } .sapMDialogSuccess > header { .sapMDialogTitleGroup .sapMDialogIcon.sapUiIcon { color: var(--sapPositiveElementColor); } & > div:last-of-type .sapMIBar { box-shadow: @_sap_m_Dialog_SuccessHeaderShadow; } } .sapMDialogInformation > header { .sapMDialogTitleGroup .sapMDialogIcon.sapUiIcon { color: var(--sapInformativeElementColor); } & > div:last-of-type .sapMIBar { box-shadow: @_sap_m_Dialog_InformationHeaderShadow; } } .sapMDialog .sapMDialogFirstFE, .sapMDialog .sapMDialogLastFE { font-size: 0; } /* to show the busy indicator over the title group */ .sapMDialog .sapUiLocalBusyIndicator { z-index: 4; }