Skip to content

Commit cfed82e

Browse files
fix(CodeModal): Add scope to backdrop CSS (#276)
Backdrop CSS change was not scoped, leading to leaking in PatternFly.org. This should scope it appopriately.
1 parent 05db337 commit cfed82e

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

packages/module/src/CodeModal/CodeModal.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.pf-chatbot__code-modal-backdrop {
2+
position: static;
3+
}
4+
15
.pf-chatbot__code-modal {
26
--pf-v6-c-modal-box--BorderRadius: var(--pf-t--global--border--radius--medium);
37
position: fixed;

packages/module/src/CodeModal/CodeModal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export const CodeModal: React.FunctionComponent<CodeModalProps> = ({
105105
aria-labelledby="code-modal-title"
106106
aria-describedby="code-modal"
107107
className={`pf-chatbot__code-modal pf-chatbot__code-modal--${displayMode}`}
108+
backdropClassName="pf-chatbot__code-modal-backdrop"
108109
>
109110
<ModalHeader title={title} labelId="code-modal-title" />
110111
<ModalBody id="code-modal-body">

packages/module/src/main.scss

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,3 @@
8585
left: 0 !important;
8686
right: auto !important;
8787
}
88-
89-
/* This is for the Code Modals, so they act like they're part of the
90-
/* chatbot. The PF modal doesn't allow us to change the position in
91-
/* a more targeted way, because you can only add classes onto the
92-
/* dialog itself. */
93-
.pf-v6-c-backdrop {
94-
position: static;
95-
}

0 commit comments

Comments
 (0)