Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
  <script>
   window.Polymer = {
      dom: 'shadow',
      // enable lazyRegister and useNativeCSSProperties
      // for Polymer 1.6.0
      lazyRegister: true,
      useNativeCSSProperties: true
    };
  </script>
  <!-- Support for native CSS properties added in 1.6.0 -->
  <base href="https://polygit.org/polymer+1.7.0/components/">
  <script src="webcomponentsjs/webcomponents-lite.min.js"></script>
  <link rel="import" href="polymer/polymer.html">
  <link rel="import" href="paper-button/paper-button.html">
  <link rel="import" href="paper-card/paper-card.html">
  <style>
  </style>
  <style is="custom-style">
    paper-card.red {
      --paper-card-header: {
    height: 500px;
    background: red;
  };
    }
  </style>
</head>
<body>
 <dom-module id="x-test">
  <template>
    <style is="custom-style">
      :host {
      }
      paper-card.icon {
        --paper-card-header: {
          height: 300px;
        };
      }
      paper-card.red {
        --paper-card-header: {
          background: red;
        };
      }
    </style>
    <paper-card heading="Card Title" class="red">
      <div class="card-content">Some content</div>
      <div class="card-actions">
        <paper-button>Some action</paper-button>
      </div>
    </paper-card>
    <paper-card heading="Card Title" class$="[[_computedClass(a)]]">
      <div class="card-content">Some content</div>
      <div class="card-actions">
        <paper-button>Some action</paper-button>
      </div>
    </paper-card>
  </template>
  <script>
   HTMLImports.whenReady(function() {
    Polymer({
      is: 'x-test',
      properties: {
        a: {
          type: String,
          value: 'red'
        }
      },
      _computedClass: function(a){
        return 'red';
      }
    });
   });
  </script>
</dom-module>
  
  <x-test></x-test>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
tony19pro
0viewers