Skip to content

[0.8] encapsulate and class binding not working well together #1240

Description

@frankiefu

When using "encapsulate", the class binding will override the class (x-app-x) set for encapsulation.

<dom-module id="x-app" encapsulate>

  <style>

    :host {
      display: block;
    }

    #foo {
      height: 100px;
      background-color: red;
    }

  </style>

  <template>

    <!-- the class binding will override the class (x-app-x) set for encapsulation and causing #foo style to not apply to the div correctly -->
    <div id="foo" class$="[[fooClass]]"></div>

  </template>

</dom-module>

<script>

  Polymer({

    is: 'x-app',

    configure: function() {
      return {
        fooClass: 'foo'
      }
    }

  });

</script>

Activity

  1. added and removed on Mar 5, 2015
  2. sorvell commented on Mar 5, 2015

    @sorvell
    Contributor

    We may sidestep this by using a styling attribute instead.

  3. sorvell commented on Mar 9, 2015

    @sorvell
    Contributor

    Fixed via 3d071ec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions