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

Add documentation for nested selectors #252

Merged
merged 2 commits into from
Aug 15, 2017
Merged

Add documentation for nested selectors #252

merged 2 commits into from
Aug 15, 2017

Conversation

silvenon
Copy link
Contributor

@silvenon silvenon commented Aug 10, 2017

The documentation for nested selectors was missing, so I read the relevant tests and comments to figure out how it works exactly and added the documentation. I'm differentiating between three types of nested selectors:

  1. regular selectors
  2. class selectors from css
  3. component selectors from styled

The first two require a leading &, but component selectors don't work that way, the & must be omitted. This inconsistency should probably be fixed at some point.

This is a part of #219.

@codecov-io
Copy link

codecov-io commented Aug 10, 2017

Codecov Report

Merging #252 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #252   +/-   ##
=======================================
  Coverage   90.23%   90.23%           
=======================================
  Files          20       20           
  Lines         963      963           
  Branches      260      260           
=======================================
  Hits          869      869           
  Misses         76       76           
  Partials       18       18

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 84d10fd...8caae70. Read the comment docs.

docs/nested.md Outdated
const paragraph = css`
color: gray;

& ${link} {
Copy link
Member

@tkh44 tkh44 Aug 11, 2017

Choose a reason for hiding this comment

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

I think it would but you would need the . before the interpolation.

@silvenon
Copy link
Contributor Author

silvenon commented Aug 12, 2017

Ok, to your dot . commit I also added a sentence explicitly explaining why it's necessary in case someone misses it when reading the code snippet. I also squashed everything into a single commit, I hope that's a desired practice.

@tkh44 tkh44 merged commit ad8d7cf into emotion-js:master Aug 15, 2017
@silvenon silvenon deleted the docs-nested-selectors branch August 16, 2017 15:43
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.

4 participants