1
0
mirror of https://github.com/nostalgic-css/NES.css.git synced 2025-08-22 13:52:48 +02:00

feat(badges): changes made that was asked by the reviewer

Removed box-sizing and border none, and classes that changed the size. Added cursor fallback and
size change by the font-size. Changed from span to a; display type; margin.

#211
This commit is contained in:
Igor Guastalla de Lima
2018-12-20 20:21:51 -02:00
parent f8a8e3184a
commit 911f281b47
2 changed files with 16 additions and 33 deletions

View File

@@ -1,6 +1,6 @@
import { storiesOf } from '@storybook/html'; // eslint-disable-line import/no-extraneous-dependencies
import { // eslint-disable-line import/no-extraneous-dependencies
withKnobs, radios, boolean,
withKnobs, radios, boolean, number
} from '@storybook/addon-knobs';
const stories = storiesOf('Badges', module);
@@ -23,17 +23,17 @@ stories.add('badges', () => {
'is-error': 'is-error',
}, 'is-success');
const sizes = radios('size', {
'is-small': 'is-small',
'is-medium': 'is-medium',
'is-large': 'is-large',
}, 'is-medium');
const fontSize = number('font-size', 1, {
range: true,
min: 0,
max: 100,
step: 0.01,
});
const isSplited = boolean('is-splited', true) ? 'is-splited' : '';
const selectedClasses = [sizes, isSplited].join(' ');
return `<span class="nes-badge ${selectedClasses}">
return `<a href="#" class="nes-badge ${isSplited}" style="font-size:${fontSize}em">
<span class="${optionsLeft}">npm</span>
<span class="${optionsRight}">1.0.0</span>
</span>`;
</a>`;
});