Skip to content

Commit

Permalink
fix(dialog): Fix dialog corners
Browse files Browse the repository at this point in the history
The dialog styles added by @sophi-est weren't being loaded into the compiled stylesheet. I've added
them to the elements index file and moved the rounded corners styles into and `.is-rounded` modifier
class.
  • Loading branch information
trezy committed Dec 18, 2018
1 parent 218b3bf commit 6258cd9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
4 changes: 3 additions & 1 deletion docs/dialogs.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ stories.addDecorator(withKnobs);

stories.add('dialog', () => {
const open = boolean('open', true) ? 'open' : '';
const isRounded = boolean('is-rounded', false) ? 'is-rounded' : '';
const selectedClasses = [isRounded];

return `<dialog ${open}>
return `<dialog class="nes-dialog ${selectedClasses.join(' ')}" ${open}>
<p class="title">Dialog</p>
<p>Alert: this is a dialog.</p>
</div>`;
Expand Down
11 changes: 6 additions & 5 deletions scss/elements/_index.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
@charset "utf-8";

@import "avatar.scss";
@import "balloons.scss";
@import "buttons.scss";
@import "containers.scss";
@import "radios.scss";
@import "checkboxes.scss";
@import "containers.scss";
@import "dialogs.scss";
@import "lists.scss";
@import "balloons.scss";
@import "tables.scss";
@import "progress.scss";
@import "avatar.scss";
@import "radios.scss";
@import "tables.scss";
9 changes: 6 additions & 3 deletions scss/elements/dialogs.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
.nes-dialog {
padding: 1.5rem 2rem;
color: $base-color;
border: none;
box-shadow: 4px 0, -4px 0, 0 4px, 0 -4px;

> .backdrop,
&::backdrop {
Expand All @@ -12,4 +9,10 @@
> :last-child {
margin-bottom: 0;
}

&.is-rounded {
color: $base-color;
border: none;
box-shadow: 4px 0, -4px 0, 0 4px, 0 -4px;
}
}

0 comments on commit 6258cd9

Please sign in to comment.