Skip to content

Commit

Permalink
fix(Development): change color default from inherit to undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Bexelius authored and bstream committed Oct 9, 2018
1 parent 6f93da2 commit 6eccfb8
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
3 changes: 0 additions & 3 deletions src/components/development/development.jsx
Expand Up @@ -101,7 +101,4 @@ Development.propTypes = {

Development.defaultProps = {
type: 'number',
positiveColor: 'inherit',
neutralColor: 'inherit',
negativeColor: 'inherit',
};
29 changes: 29 additions & 0 deletions src/components/development/development.md
Expand Up @@ -80,3 +80,32 @@ Override colors examples:
<Development value={ -11.4 } {...customColors} />
</span>
</div>


Override colors with classes examples:

<div>
<style>{`
.gold {
color: gold;
}

.silver {
color: silver;
}

.brown {
color: brown;
}

`}</style>
<span style={{marginRight: '2rem'}}>
<Development className="gold" value={ 9.2 } />
</span>
<span style={{marginRight: '2rem'}}>
<Development className="silver" value={ -11.4 } />
</span>
<span style={{marginRight: '2rem'}}>
<Development className="brown" value={ 100.0 } />
</span>
</div>
4 changes: 2 additions & 2 deletions test/components/development.test.js
Expand Up @@ -106,10 +106,10 @@ describe('<Development />', () => {
});

describe('Custom colors', () => {
it('should default to color: "inherit"', () => {
it('should default to undefined', () => {
const component = shallow(<Development value={0} type="number" />);
const { color } = component.find(Number).prop('style');
expect(color).to.equal('inherit');
expect(color).to.equal(undefined);
});

it('should be possible to override positive color', () => {
Expand Down

0 comments on commit 6eccfb8

Please sign in to comment.