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

feat: add "col" property in theme #78

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sstefoss
Copy link

@sstefoss sstefoss commented Sep 3, 2017

Added "col" property in theme in order to set the default breakpoint value of a Column.
Closes #72

@codecov
Copy link

codecov bot commented Sep 3, 2017

Codecov Report

Merging #78 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #78   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          11     11           
  Lines          90     93    +3     
  Branches       23     24    +1     
=====================================
+ Hits           90     93    +3
Impacted Files Coverage Δ
src/theme/theme.js 100% <ø> (ø) ⬆️
src/theme/defaultTheme.js 100% <ø> (ø) ⬆️
src/helpers/columnWidth/columnWidth.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5b1fbfc...a306b72. Read the comment docs.

const value = has(props, `${breakpoint}`)
? props[breakpoint]
: theme(props).col[breakpoint];
return (Math.abs(value) / theme(props).columns) * 100;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you return undefined as a value, does this line work fine or does it throw an error?

Copy link
Author

@sstefoss sstefoss Sep 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't throw an error but you are right, there is no reason to have code smell. Just committed a fix a306b72

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sstefoss! Will do a final test through and merge soon! :)

@aaronvanston
Copy link
Owner

Nice PR, thanks for spending the time to complete this! I will pull this down and test locally. Will merge ASAP! :)

@aaronvanston
Copy link
Owner

@sstefoss Apologies for the delay. I had been some testing and noticed some issues when running this via the storybook document. I will need to do some investigation to see what is going wrong (odd column stacking and height).

In addition We should also add documentation on this feature within both the react-flexa README.md and the Col readme. I'm happy to help with this if need be.

@aaronvanston
Copy link
Owner

The issue with the height looks to be an issue more with an older cached version of storybook rather than your changes. I will investigate further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants