Skip to content

Commit 0ea45ce

Browse files
committed
Correcting sizing styles more
1 parent 343db7b commit 0ea45ce

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

packages/compass-components/src/components/modals/modal.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import { Body, Modal as LeafyGreenModal } from '../leafygreen';
55
import { withStackedComponentStyles } from '../../hooks/use-stacked-component';
66

77
const styles = css({
8+
// Force the width and height and margins to never extend the containing element
9+
maxHeight: `calc(100% - 2 * ${spacing['600']}px)`,
10+
maxWidth: `calc(100% - 2 * ${spacing['800']}px)`,
11+
812
letterSpacing: 0,
913
padding: 0,
1014
// The LG modal applies transform: translate3d(0, 0, 0) style to the modal
@@ -17,12 +21,8 @@ const styles = css({
1721
});
1822

1923
const fullScreenStyles = css({
20-
top: spacing['600'],
21-
bottom: spacing['600'],
22-
left: spacing['800'],
23-
right: spacing['800'],
2424
height: 'auto',
25-
width: 'auto',
25+
width: '100%',
2626
'& > div': {
2727
height: '100%',
2828
maxHeight: '100%',
@@ -39,9 +39,13 @@ function UnwrappedModal({
3939
}): React.ReactElement {
4040
return (
4141
<LeafyGreenModal
42-
className={cx(styles, className, {
43-
[fullScreenStyles]: fullScreen && props.open,
44-
})}
42+
className={cx(
43+
styles,
44+
{
45+
[fullScreenStyles]: fullScreen && props.open,
46+
},
47+
className
48+
)}
4549
/* For now, we're defaulting to not auto-focus the first focusable element */
4650
initialFocus={null}
4751
{...props}

packages/connection-form/src/components/connection-form-modal.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import ConnectionForm from './connection-form';
66

77
const styles = css({
88
width: '960px',
9-
maxWidth: '960px',
109
});
1110

1211
export default function ConnectionFormModal({

0 commit comments

Comments
 (0)