Polymer 聚合物1.x:造纸厂标高不起作用?

Polymer 聚合物1.x:造纸厂标高不起作用?,polymer,polymer-1.0,paper-elements,Polymer,Polymer 1.0,Paper Elements,,我正在尝试向我的元素添加一个纸工厂 我希望看到与高程属性对应的阴影。但我看不到影子。所有立面似乎都有相同的阴影(暗示z深度) 我的代码或元素有问题吗 http://jsbin.com/corisahoqi/edit?html,输出 <!doctype html> <head> <meta charset="utf-8"> <!---- > <base href="https://polygit.org/components/"&

,我正在尝试向我的元素添加一个
纸工厂

我希望看到与
高程
属性对应的阴影。但我看不到影子。所有立面似乎都有相同的阴影(暗示z深度)

我的代码或元素有问题吗

http://jsbin.com/corisahoqi/edit?html,输出
<!doctype html>
<head>
  <meta charset="utf-8">
  <!---- >
  <base href="https://polygit.org/components/">
  <!---- >
  Toggle below/above as backup when server is down
  <!---->
  <base href="https://polygit2.appspot.com/components/">
  <!---->
  <script src="webcomponentsjs/webcomponents-lite.min.js"></script>
  <link href="polymer/polymer.html" rel="import">
  <link href="paper-fab/paper-fab.html" rel="import">
  <link href="iron-icons/iron-icons.html" rel="import">
</head>
<body>

<dom-module id="x-element">

<template>
  <style>
    paper-fab {
      margin: 15px;
    }
  </style>
  <paper-fab icon="add" elevation="5"></paper-fab>
  <paper-fab icon="add" elevation="4"></paper-fab>
  <paper-fab icon="add" elevation="3"></paper-fab>
  <paper-fab icon="add" elevation="2"></paper-fab>
  <paper-fab icon="add" elevation="1"></paper-fab>

</template>

<script>
  (function(){
    Polymer({
      is: "x-element",
    });
  })();
</script>

</dom-module>

<x-element></x-element>

</body>
<!doctype html>
<head>
  <meta charset="utf-8">
  <!---- >
  <base href="https://polygit.org/components/">
  <!---- >
  Toggle below/above as backup when server is down
  <!---->
  <base href="https://polygit2.appspot.com/components/">
  <!---->
  <script src="webcomponentsjs/webcomponents-lite.min.js"></script>
  <link href="polymer/polymer.html" rel="import">
  <link href="paper-fab/paper-fab.html" rel="import">
  <link href="iron-icons/iron-icons.html" rel="import">
</head>
<body>

<dom-module id="x-element">

<template>
  <style>
    paper-fab:hover {
      box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.3);
    }
  </style>
  <paper-fab icon="send"></paper-fab>

</template>

<script>
  (function(){
    Polymer({
      is: "x-element",
    });
  })();
</script>

</dom-module>

<x-element></x-element>

</body>

造纸厂{
利润率:15px;
}
(功能(){
聚合物({
是:“x元素”,
});
})();

在我看来,元素有问题。在现实生活中,这听起来似乎可以按照你的意愿来使用

此元素的z深度,从0到5。设置为0将移除阴影,并且每增加一个大于0的数字将比最后一个“更深”


但是,
高程
属性是只读的,所以设置它没有效果。

在我看来,元素有问题。在现实生活中,这听起来似乎可以按照你的意愿来使用

此元素的z深度,从0到5。设置为0将移除阴影,并且每增加一个大于0的数字将比最后一个“更深”


但是,
elevation
属性是只读的,因此设置它没有任何效果。

paper fab
实现了
paper按钮行为
。正如@Maria提到的
高程
仅返回结果高程,它是只读的,无法设置


您可以尝试添加一些属性,如
升高的
(?)、
聚焦的
(?)、
禁用的
(0)、
激活的
(4)、
按下的
(4)、
从键盘接收的焦点
(3),这些属性应该可以美化立面,但这似乎是所有支持的属性(如果有的话)

paper fab
实现
纸张按钮行为
。正如@Maria提到的
高程
仅返回结果高程,它是只读的,无法设置

您可以尝试添加一些属性,如
升高的
(?)、
聚焦的
(?)、
禁用的
(0)、
激活的
(4)、
按下的
(4)、
从键盘接收的焦点
(3),这些属性应该可以美化立面,但这似乎是所有支持的属性(如果有的话)

因此,作为一个面片,在悬停上添加一个阴影来模拟

按钮高度。凸起按钮的默认标高为2dp。在桌面上,凸起的按钮可以在悬停时获得此高度

http://jsbin.com/hitororuja/edit?html,输出
<!doctype html>
<head>
  <meta charset="utf-8">
  <!---- >
  <base href="https://polygit.org/components/">
  <!---- >
  Toggle below/above as backup when server is down
  <!---->
  <base href="https://polygit2.appspot.com/components/">
  <!---->
  <script src="webcomponentsjs/webcomponents-lite.min.js"></script>
  <link href="polymer/polymer.html" rel="import">
  <link href="paper-fab/paper-fab.html" rel="import">
  <link href="iron-icons/iron-icons.html" rel="import">
</head>
<body>

<dom-module id="x-element">

<template>
  <style>
    paper-fab {
      margin: 15px;
    }
  </style>
  <paper-fab icon="add" elevation="5"></paper-fab>
  <paper-fab icon="add" elevation="4"></paper-fab>
  <paper-fab icon="add" elevation="3"></paper-fab>
  <paper-fab icon="add" elevation="2"></paper-fab>
  <paper-fab icon="add" elevation="1"></paper-fab>

</template>

<script>
  (function(){
    Polymer({
      is: "x-element",
    });
  })();
</script>

</dom-module>

<x-element></x-element>

</body>
<!doctype html>
<head>
  <meta charset="utf-8">
  <!---- >
  <base href="https://polygit.org/components/">
  <!---- >
  Toggle below/above as backup when server is down
  <!---->
  <base href="https://polygit2.appspot.com/components/">
  <!---->
  <script src="webcomponentsjs/webcomponents-lite.min.js"></script>
  <link href="polymer/polymer.html" rel="import">
  <link href="paper-fab/paper-fab.html" rel="import">
  <link href="iron-icons/iron-icons.html" rel="import">
</head>
<body>

<dom-module id="x-element">

<template>
  <style>
    paper-fab:hover {
      box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.3);
    }
  </style>
  <paper-fab icon="send"></paper-fab>

</template>

<script>
  (function(){
    Polymer({
      is: "x-element",
    });
  })();
</script>

</dom-module>

<x-element></x-element>

</body>

造纸厂:悬停{
盒影:0 4px10px 0 rgba(0,0,0,0.3);
}
(功能(){
聚合物({
是:“x元素”,
});
})();

因此,作为一个面片,在悬停上添加一个阴影来模拟

按钮高度。凸起按钮的默认标高为2dp。在桌面上,凸起的按钮可以在悬停时获得此高度

http://jsbin.com/hitororuja/edit?html,输出
<!doctype html>
<head>
  <meta charset="utf-8">
  <!---- >
  <base href="https://polygit.org/components/">
  <!---- >
  Toggle below/above as backup when server is down
  <!---->
  <base href="https://polygit2.appspot.com/components/">
  <!---->
  <script src="webcomponentsjs/webcomponents-lite.min.js"></script>
  <link href="polymer/polymer.html" rel="import">
  <link href="paper-fab/paper-fab.html" rel="import">
  <link href="iron-icons/iron-icons.html" rel="import">
</head>
<body>

<dom-module id="x-element">

<template>
  <style>
    paper-fab {
      margin: 15px;
    }
  </style>
  <paper-fab icon="add" elevation="5"></paper-fab>
  <paper-fab icon="add" elevation="4"></paper-fab>
  <paper-fab icon="add" elevation="3"></paper-fab>
  <paper-fab icon="add" elevation="2"></paper-fab>
  <paper-fab icon="add" elevation="1"></paper-fab>

</template>

<script>
  (function(){
    Polymer({
      is: "x-element",
    });
  })();
</script>

</dom-module>

<x-element></x-element>

</body>
<!doctype html>
<head>
  <meta charset="utf-8">
  <!---- >
  <base href="https://polygit.org/components/">
  <!---- >
  Toggle below/above as backup when server is down
  <!---->
  <base href="https://polygit2.appspot.com/components/">
  <!---->
  <script src="webcomponentsjs/webcomponents-lite.min.js"></script>
  <link href="polymer/polymer.html" rel="import">
  <link href="paper-fab/paper-fab.html" rel="import">
  <link href="iron-icons/iron-icons.html" rel="import">
</head>
<body>

<dom-module id="x-element">

<template>
  <style>
    paper-fab:hover {
      box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.3);
    }
  </style>
  <paper-fab icon="send"></paper-fab>

</template>

<script>
  (function(){
    Polymer({
      is: "x-element",
    });
  })();
</script>

</dom-module>

<x-element></x-element>

</body>

造纸厂:悬停{
盒影:0 4px10px 0 rgba(0,0,0,0.3);
}
(功能(){
聚合物({
是:“x元素”,
});
})();