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

considering removing locations #30

Open
geddski opened this issue Feb 14, 2015 · 12 comments
Open

considering removing locations #30

geddski opened this issue Feb 14, 2015 · 12 comments

Comments

@geddski
Copy link
Owner

geddski commented Feb 14, 2015

After some great feedback from Paul Irish and a lot of brainstorming, I think we could probably remove locations entirely. Locations' purpose are to allow consumers of a component to override aspects of the component when it's being used in a certain context. It's a common use case and csstyle needs to support it. Locations have a couple of problems however:

  1. Because they use id they automatically override every part of component, including its options. So if you wanted to override the base style of a component using a location but leave it alone when it's using an option, you're out of luck.
  2. People start using locations in places where they really should be using a component.
  3. There are a lot of semantics to remember with components, parts, options, tweaks, & locations.

I think components themselves provide enough context:

@include component(sidebar){
  @include component(button){
    // override some aspect of button when inside sidebar
  }
}

And they do this with a single class name rather than an id. The only problem with this is that options and parts also only add a single class name. This would lead to load-order importance which is something csstyle is supposed to handle for you. One option would be to have csstyle add another class onto the parts & options selectors that get generated so that they are automatically more specific than the base styles applied to a component inside of another component.

I'm open to ideas and feedback before making a breaking change like this.

@robclancy
Copy link

I don't think they are really needed. The use cases can easily be achieved in other ways, like a simple option for some custom page that is a little different.

@ebrentnelson
Copy link
Collaborator

+1

@stinoga
Copy link
Collaborator

stinoga commented Mar 19, 2015

+1 for anything that anything that drops using id.

@geddski
Copy link
Owner Author

geddski commented Apr 3, 2015

Planning on removing locations. @stinoga the id will still be used for tweaks, unless we can think of some other clever way to make them automatically override any level of nested components/parts/options.

@jesseleite
Copy link
Contributor

@geddski If you are still thinking of removing @Locations, maybe you should do so before too many people marry themselves to it. Or at least remove it from the http://csstyle.io page to discourage it's use. Thoughts?

@simonj
Copy link
Contributor

simonj commented Aug 22, 2015

+1

@geddski
Copy link
Owner Author

geddski commented Sep 2, 2015

that is a good idea. I'll remove it from the docs and tests to start.

@jesseleite
Copy link
Contributor

He's alive!

@geddski
Copy link
Owner Author

geddski commented Sep 2, 2015

@jesseleite indubitably :)

@geddski
Copy link
Owner Author

geddski commented Sep 2, 2015

http://www.csstyle.io/ updated to remove locations.

@simonj
Copy link
Contributor

simonj commented Sep 3, 2015

Good job @geddski !

@FWSimon
Copy link

FWSimon commented Nov 4, 2015

This should be closed, right :)?

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

7 participants