Skip to content

Commit

Permalink
Merge pull request #92 from josemarluedke/feat/modal-configs
Browse files Browse the repository at this point in the history
Split modal style configuration for padding
  • Loading branch information
josemarluedke committed Aug 21, 2020
2 parents 7b28922 + a1a88a5 commit ec4c0d9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
19 changes: 11 additions & 8 deletions packages/overlays/addon/tailwind/default-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ const defaultConfig = {
borderRadius: defaultTheme.borderRadius.default,
backdropColor: 'rgba(0, 0, 0, 0.45)',
modal: {
padding: defaultTheme.padding[4],
headerPadding: defaultTheme.padding[4],
bodyPadding: defaultTheme.padding[4],
footerPadding: defaultTheme.padding[4],
backgroundColor: defaultTheme.colors.white,
secondaryBackgroundColor: defaultTheme.colors.gray[100], // Background for footer and close btn applied on hover
iconColor: 'currentColor',
iconColor: defaultTheme.colors.black,
borderColor: defaultTheme.borderColor.default,
maxWidth: defaultTheme.maxWidth['xl']
maxWidth: defaultTheme.maxWidth['xl'],
closeBtnMargin: defaultTheme.spacing[2]
}
};

Expand Down Expand Up @@ -74,8 +77,8 @@ function defaultOptions({ config }) {
position: 'absolute',
fontSize: defaultTheme.fontSize.xl,
padding: defaultTheme.spacing[2],
top: defaultTheme.padding[2],
right: defaultTheme.padding[2],
top: config.modal.closeBtnMargin,
right: config.modal.closeBtnMargin,
transitionProperty: defaultTheme.transitionProperty.default,
transitionDuration: defaultTheme.transitionDuration[200],
borderRadius: defaultTheme.borderRadius.full,
Expand All @@ -101,20 +104,20 @@ function defaultOptions({ config }) {
header: {
fontWeight: defaultTheme.fontWeight.bold,
fontSize: defaultTheme.fontSize.xl,
padding: config.modal.padding,
padding: config.modal.headerPadding,
borderTopRightRadius: config.borderRadius,
borderTopLeftRadius: config.borderRadius
},
body: {
padding: config.modal.padding
padding: config.modal.bodyPadding
},
footer: {
display: 'flex',
justifyContent: 'flex-end',
backgroundColor: config.modal.secondaryBackgroundColor,
borderTopWidth: defaultTheme.borderWidth.default,
borderTopColor: config.modal.borderColor,
padding: config.modal.padding,
padding: config.modal.footerPadding,
borderBottomRightRadius: config.borderRadius,
borderBottomLeftRadius: config.borderRadius
}
Expand Down
3 changes: 3 additions & 0 deletions packages/overlays/tests/dummy/app/components/demo-modal.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
<p>Some contents...</p>
<p>Some contents...</p>
<p>Some contents...</p>
<p>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
</p>
</m.Body>
<m.Footer>
<Button
Expand Down

0 comments on commit ec4c0d9

Please sign in to comment.