googlearchive / paper-tabs

A tabs à la Material Design
22 stars 21 forks source link

Please add a way to run/debug these components stand-alone #41

Open kristianmandrup opened 9 years ago

kristianmandrup commented 9 years ago

These paper elements aren't really "self-contained". I can't simply clone the repo, bower install, open the demo and work from there... Looks like the repo has to exists within a specific app structure...

From demo.html

  <script src="../webcomponentsjs/webcomponents.js"></script>
  <link rel="import" href="../core-icons/core-icons.html">
  <link rel="import" href="../font-roboto/roboto.html">
  <link rel="import" href="paper-tabs.html">
  <link rel="import" href="../core-toolbar/core-toolbar.html">
  <link rel="import" href="../core-media-query/core-media-query.html">
  <link rel="import" href="../paper-icon-button/paper-icon-button.html">

Running bower install will install all components into bower components folder. What is the recommended structure for this to work? Why not add a dev folder which sets up the infrastructure to reference the outer paper-tabs files but can run stand-alone? or some other way?

Also, please add some documentation for getting started (ie. contribution guide lines) and more on how scrolling behaviour is intended to work. Thanks :)

arthurevans commented 9 years ago

Because of the way HTML imports dedups imports, you pretty much need a flat dependency tree. So the standard way to do this is to set the bower directory to "../", so dependencies are installed in sibling directories.

Here's the outline:

  1. Create a directory, say, "polymer-dev", where you want to work.
  2. lone the paper-tabs repo inside polymer-dev.
  3. Add a .bowerrc in the paper-tabs directory like this:
{
  "directory": "../"
}

Now you can run bower install and everything should just work. (I think the .bowerrc isn't there by default because of the risk of people polluting their directories if they run this in the wrong place.)

+1 on adding a contributing doc. Existing notes on contributing are outdated. Let me see if there's a bug for that.