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

About Simplifying nested components #40

Closed
exalted opened this issue Feb 7, 2016 · 1 comment
Closed

About Simplifying nested components #40

exalted opened this issue Feb 7, 2016 · 1 comment

Comments

@exalted
Copy link

exalted commented Feb 7, 2016

In section Simplifying nested components the example given is this:

<div class='search-form'>
  <input class='input' type='text'>
  <button class='search-button -red -large'></button>
</div>

It curious how the "search button" is labeled as a component (or a nested component in this example) rather than an element, such as:

<div class='search-form'>
  <input class='input' type='text'>
  <button class='searchbutton -red -large'></button>
</div>

... and then for the solution it's "converted" to an element with class submit. This is pretty confusing, because the solution not only suggesting using @extend, but also refactors the DOM. I know you shouldn't reach into nested components however, so the following is not good:

.search-form {
  > .search-button { /* ... */ }
}

But then I don't quite follow how good is @extend as a solution to a non-problem in the first place. I am pretty confused.

I guess my question is pretty much aligned with #9 at this point, although I would like to hear more on this.

Thanks

@rstacruz
Copy link
Owner

rstacruz commented Feb 8, 2016

I know you shouldn't reach into nested components however, so the following is not good:

good point, that should probably be changed; that wasn't a good example to begin with.

@exalted exalted closed this as completed Jun 23, 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

No branches or pull requests

2 participants