File tree Expand file tree Collapse file tree 4 files changed +58
-0
lines changed
Expand file tree Collapse file tree 4 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ import { storiesOf } from '@storybook/html' ; // eslint-disable-line import/no-extraneous-dependencies
2+ import { // eslint-disable-line import/no-extraneous-dependencies
3+ withKnobs , radios , boolean ,
4+ } from '@storybook/addon-knobs' ;
5+
6+ const stories = storiesOf ( 'Avatars' , module ) ;
7+ stories . addDecorator ( withKnobs ) ;
8+
9+ stories . add ( 'avatars' , ( ) => {
10+ const options = radios ( 'class' , {
11+ 'is-small' : 'is-small' ,
12+ default : '' ,
13+ 'is-medium' : 'is-medium' ,
14+ 'is-large' : 'is-large' ,
15+ } , '' ) ;
16+ const isRounded = boolean ( 'is-rounded' , false ) ? 'is-rounded' : '' ;
17+ const selectedClasses = [ isRounded , options ] . join ( ' ' ) ;
18+
19+ return `<img src="http://www.gravatar.com/avatar" class="nes-avatar ${ selectedClasses } ">` ;
20+ } ) ;
Original file line number Diff line number Diff line change @@ -94,6 +94,20 @@ <h2 class="title">Checkboxes</h2>
9494 </ label >
9595 </ section >
9696
97+ < section class ="nes-container with-title ">
98+ < h2 class ="title "> Avatars</ h2 >
99+ < div >
100+ < img src ="http://www.gravatar.com/avatar " class ="nes-avatar is-small ">
101+ < img src ="http://www.gravatar.com/avatar " class ="nes-avatar ">
102+ < img src ="http://www.gravatar.com/avatar " class ="nes-avatar is-medium ">
103+ < img src ="http://www.gravatar.com/avatar " class ="nes-avatar is-large ">
104+ < img src ="http://www.gravatar.com/avatar " class ="nes-avatar is-small is-rounded ">
105+ < img src ="http://www.gravatar.com/avatar " class ="nes-avatar is-rounded ">
106+ < img src ="http://www.gravatar.com/avatar " class ="nes-avatar is-medium is-rounded ">
107+ < img src ="http://www.gravatar.com/avatar " class ="nes-avatar is-large is-rounded ">
108+ </ div >
109+ </ section >
110+
97111 < section class ="form nes-container with-title ">
98112 < h2 class ="title "> Form</ h2 >
99113 < div class ="nes-field ">
Original file line number Diff line number Diff line change 77@import " balloons.scss" ;
88@import " tables.scss" ;
99@import " progress.scss" ;
10+ @import " avatar.scss" ;
Original file line number Diff line number Diff line change 1+ @mixin img-style ($param ) {
2+ $size : $param * 16 ;
3+
4+ width : $size ;
5+ height : $size ;
6+
7+ & .is-rounded {
8+ border-radius : 50px ;
9+ }
10+ }
11+ .nes-avatar {
12+ @include img-style (2px );
13+
14+ & .is-small {
15+ @include img-style (1px );
16+ }
17+ & .is-medium {
18+ @include img-style (3px );
19+ }
20+ & .is-large {
21+ @include img-style (4px );
22+ }
23+ }
You can’t perform that action at this time.
0 commit comments