Skip to content

Commit 66b535a

Browse files
fix: static dialog nobackdrop position fix [ci-visual]
1 parent a9e8ed1 commit 66b535a

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

src/styles/dialog.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,10 @@ $button: #{$fd-namespace}-button;
175175
color: $fd-dialog-resize-handle-color;
176176
}
177177
}
178+
179+
&--no-backdrop:not(.#{$block}--targeted) {
180+
@include fd-position-center($position: fixed);
181+
182+
z-index: 1000;
183+
}
178184
}

src/styles/flexible-column-layout.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ $block: #{$fd-namespace}-flexible-column-layout;
5858
padding: 0;
5959
z-index: 2;
6060

61-
@include fd-absolute-center();
61+
@include fd-position-center();
6262
}
6363

6464
&__column {

src/styles/mixins/_mixins.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,8 @@
365365
transform: translateX(-50%);
366366
}
367367

368-
@mixin fd-absolute-center {
369-
position: absolute;
368+
@mixin fd-position-center($position: absolute) {
369+
position: $position;
370370
left: 50%;
371371
top: 50%;
372372
transform: translate(-50%, -50%);

stories/dialog/dialog.stories.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ The dialog component is a container that appears in response to an action made b
3434
- \`fd-dialog__decisive-button\` Dialog footer's _Begin/End_ button
3535
- \`fd-dialog__resize-handle\` Handle for resizing modal
3636
37+
**Additional classes (applied to main \`.fd-dialog\` element):**
38+
39+
- \`fd-dialog--no-backdrop\` needed, if dialog is used without overlay. Centers the dialog vertically and horizontally
40+
- \`fd-dialog--targeted\` to be used, if dialog is attached to the specific element, not body
41+
3742
Note: Dialog's header, subheader and footer are elements from the **Bar** component. This means that dialog headers and footers can be customized using bar component features. To style the elements according to dialog’s needs, CSS classes are used to slightly override bar’s original behaviour.
3843
`,
3944
tags: ['f3', 'a11y', 'theme'],

0 commit comments

Comments
 (0)