Skip to content

Loading…

Shady dom scrimshawing problems if a custom property is missing #2218

Closed
notwaldorf opened this Issue · 1 comment

2 participants

@notwaldorf
Owner

TL; DR: if a custom element uses a custom property that doesn't exist, other styles using custom properties that follow it won't get applied (in Chrome).

Custom element:

<link rel="import" href="bower_components/polymer/polymer.html">
<link rel="import" href="bower_components/paper-icon-button/paper-icon-button.html">
<link rel="import" href="bower_components/iron-icons/iron-icons.html">
</style>
<dom-module id="simple-element">
  <style>
    paper-icon-button {
      color: var(--ghost-property-doesnt-exist);
      --iron-icon-width: 10px;    /* doesn't get applied */
      --iron-icon-height: 10px;   /* doesn't get applied */
      margin-left: 10px;          /* applied */
    }
  </style>
  <template>
      <paper-icon-button icon="bug-report"></paper-icon-button>
  </template>
</dom-module>
<script>
  Polymer({
    is: 'simple-element'
  });
</script>

Usage:

<!doctype html>
<html>
<head>
  <script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
  <link rel="import" href="simple-element.html">
</head>
<body>
  <simple-element></simple-element>
  <simple-element></simple-element>
  <simple-element></simple-element>
</body>
</html>

Result in Chrome (they should all be the same size, but they're not. They're fine in Safari & Firefox):
screen shot 2015-08-06 at 3 39 26 pm

@sorvell sorvell was assigned by notwaldorf
@sorvell sorvell added the p1 label
@sorvell sorvell closed this issue from a commit
@sorvell sorvell Fixes #2218: match style properties against scope transformed selecto…
…r (not property unique selector)
c9e9062
@sorvell sorvell closed this in c9e9062
@notwaldorf
Owner

@sorvell a++ great straw man :wink:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.