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

Adds Text Inputs and Buttons Selector Shorthand #57

Merged
merged 5 commits into from
Dec 16, 2016
Merged

Adds Text Inputs and Buttons Selector Shorthand #57

merged 5 commits into from
Dec 16, 2016

Conversation

bhough
Copy link
Contributor

@bhough bhough commented Dec 16, 2016

Adds shorthand helper for textInput and buttonsselectors, including active, focus, and hover states.

@codecov-io
Copy link

codecov-io commented Dec 16, 2016

Current coverage is 100% (diff: 100%)

Merging #57 into master will not change coverage

@@           master   #57   diff @@
===================================
  Files          15    18     +3   
  Lines          57    73    +16   
  Methods         0     0          
  Messages        0     0          
  Branches        0     0          
===================================
+ Hits           57    73    +16   
  Misses          0     0          
  Partials        0     0          

Powered by Codecov. Last update 0ac5814...46aeb71

@bhough bhough requested review from mxstbr and removed request for mxstbr December 16, 2016 01:44
@bhough
Copy link
Contributor Author

bhough commented Dec 16, 2016

After working on the Buttons shorthand, I'm going to refactor this a bit to use a shared helper and leverage tagged template literals to produce the selectors.

@mxstbr mxstbr mentioned this pull request Dec 16, 2016
50 tasks
@bhough bhough changed the title Adds Text Inputs Selector Shorthand Adds Text Inputs and Buttons Selector Shorthand Dec 16, 2016
@bhough bhough requested a review from mxstbr December 16, 2016 16:32
Copy link
Member

@mxstbr mxstbr left a comment

Choose a reason for hiding this comment

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

Don't forget to add it to .documentation.json in the ToC!

| null
| string;

function statefulSelectors(states: Array<State>, template: Function, stateMap: ?Array<State>) {
Copy link
Member

Choose a reason for hiding this comment

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

Would be nice to have a small high-level comment explaining why we need this!

* const div = styled.div`
* ${buttons('active')} {
* border: none;
* }
Copy link
Member

Choose a reason for hiding this comment

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

This actually doesn't make sense like this in styled-components, if anything this should be:

const div = styled.div`
  > ${buttons('active')} {
    border: none;
  }
`

*
* // styled-components usage
* const div = styled.div`
* ${textInputs('active')} {
Copy link
Member

Choose a reason for hiding this comment

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

Same as above, needs >

@bhough
Copy link
Contributor Author

bhough commented Dec 16, 2016

@mxstbr should be good now assuming CI passes.

@bhough bhough mentioned this pull request Dec 16, 2016
"hiDPI",
"selection",
"placeholder",
"retinaImage",
Copy link
Member

Choose a reason for hiding this comment

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

Those were done in #59 🙈 Would you mind merging that first, rebasing on top of master and then adding the shorthands? Thanks and sorry for the troubles!

Adds shorthand helper for textInput selectors, including active, focus, and hover states.
buttons and textInputs shorthand now use a shared internalHelper statefulSelectors. Also removed

build export for polished.
Updated styled-components example in buttons and textInputs. Added private doc explaining why we use

the statefulSelectors internal helper
Update TOC with missing modules
@bhough
Copy link
Contributor Author

bhough commented Dec 16, 2016

Ok @mxstbr rebased on master post #59 merge.

Copy link
Member

@mxstbr mxstbr left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! Sorry for the troubles!

@mxstbr mxstbr merged commit c800b90 into master Dec 16, 2016
@mxstbr mxstbr deleted the inputs branch December 16, 2016 20:12
@bhough bhough mentioned this pull request Dec 16, 2016
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