Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for HTML dialog object #171

Merged
merged 14 commits into from
Dec 13, 2018
9 changes: 9 additions & 0 deletions css/nes.min.css

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions docs/dialogs.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { storiesOf } from '@storybook/html'; // eslint-disable-line import/no-extraneous-dependencies
import { // eslint-disable-line import/no-extraneous-dependencies
withKnobs, boolean,
} from '@storybook/addon-knobs';

const stories = storiesOf('Dialogs', module);
stories.addDecorator(withKnobs);

stories.add('dialog', () => {
const open = boolean('open', true) ? 'open' : '';

return `<dialog ${open}>
<p class="title">Dialog</p>
<p>Alert: this is a dialog.</p>
</div>`;
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"build:cleancss": "cleancss -o css/nes.min.css css/nes.css",
"storybook": "start-storybook -p 6006",
"build:storybook": "build-storybook",
"build-storybook": "npm run storybook",
amity marked this conversation as resolved.
Show resolved Hide resolved
"deploy": "npm run build",
"semantic-release": "semantic-release",
"commit": "git-cz",
Expand Down
33 changes: 33 additions & 0 deletions scss/elements/dialogs.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
dialog {
amity marked this conversation as resolved.
Show resolved Hide resolved
position: relative;
amity marked this conversation as resolved.
Show resolved Hide resolved
padding: 1.5rem 2rem;

> :last-child {
margin-bottom: 0;
}

&::before,
&::after {
position: absolute;
z-index: -1;
content: "";
}

&::before {
top: 0;
right: 0;
bottom: 0;
left: 0;
}

&::after {
top: 2px;
right: 2px;
bottom: 2px;
left: 2px;
border-color: $base-color;
border-style: solid;
border-width: 4px;
border-radius: 4px;
}
amity marked this conversation as resolved.
Show resolved Hide resolved
}