更改core-tooltip默认背景颜色

时间:2015-01-28 00:28:55

标签: dart dart-polymer material-design core-elements

我有以下.html代码

<core-tooltip tipAttribute='tipp'
  id='clock-icon-tip'
  style='background-color: blue;'>
  <div tipp
    style='background-color: red; width: 100%; height: 100%;'>
    <p>this is my tool<br> tip</p>

  </div>
  <core-icon id='clock-icon' class='margin-l-b-4px' icon=''></core-icon>
</core-tooltip>

显示如下所示

enter image description here

如何将黑色背景颜色设为红色。 感谢

1 个答案:

答案 0 :(得分:0)

我将内联样式移动到样式标记,因为我认为这是应该如何完成的 我删除了tipAttribute,因为它对我不起作用(可能https://github.com/Polymer/core-tooltip/issues/26最近已修复)。

<template>
  <style>
      core-tooltip#clock-icon-tip core-icon {
        background-color: blue;
      }

      /* tooltip content */
      core-tooltip#clock-icon-tip > [tip],
      /* tooltip background */
      core-tooltip#clock-icon-tip::shadow .core-tooltip {
        background-color: red;
        /*width: 100%;
        height: 100%;*/
      } 

      /* tooltip arrow 
         (needs a rule for each tooltip position, this is for bottom only */
      core-tooltip#clock-icon-tip::shadow .core-tooltip.bottom::after {
        border-bottom-color: red;
      }

  </style>

  <core-tooltip 
    id='clock-icon-tip'
    >
    <div tip>
      <p>this is my tool<br> tip</p>

    </div>
    <core-icon id='clock-icon' class='margin-l-b-4px' icon=''></core-icon>
  </core-tooltip>
</template>
相关问题