diff --git a/docs/avatars.stories.js b/docs/avatars.stories.js new file mode 100644 index 0000000..c1a213d --- /dev/null +++ b/docs/avatars.stories.js @@ -0,0 +1,20 @@ +import { storiesOf } from '@storybook/html'; // eslint-disable-line import/no-extraneous-dependencies +import { // eslint-disable-line import/no-extraneous-dependencies + withKnobs, radios, boolean, +} from '@storybook/addon-knobs'; + +const stories = storiesOf('Avatars', module); +stories.addDecorator(withKnobs); + +stories.add('avatars', () => { + const options = radios('class', { + 'is-small': 'is-small', + default: '', + 'is-medium': 'is-medium', + 'is-large': 'is-large', + }, ''); + const isRounded = boolean('is-rounded', false) ? 'is-rounded' : ''; + const selectedClasses = [isRounded, options].join(' '); + + return ``; +}); diff --git a/index.html b/index.html index deaf295..82ea354 100644 --- a/index.html +++ b/index.html @@ -94,6 +94,20 @@ +
+

Avatars

+
+ + + + + + + + +
+
+

Form

diff --git a/scss/elements/_index.scss b/scss/elements/_index.scss index adeb4b4..28d7130 100644 --- a/scss/elements/_index.scss +++ b/scss/elements/_index.scss @@ -7,3 +7,4 @@ @import "balloons.scss"; @import "tables.scss"; @import "progress.scss"; +@import "avatar.scss"; diff --git a/scss/elements/avatar.scss b/scss/elements/avatar.scss new file mode 100644 index 0000000..c31fc62 --- /dev/null +++ b/scss/elements/avatar.scss @@ -0,0 +1,23 @@ +@mixin img-style($param) { + $size: $param * 16; + + width: $size; + height: $size; + + &.is-rounded { + border-radius: 50px; + } +} +.nes-avatar { + @include img-style(2px); + + &.is-small { + @include img-style(1px); + } + &.is-medium { + @include img-style(3px); + } + &.is-large { + @include img-style(4px); + } +}