Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
use /deep/ for stylings
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiefu committed Jun 2, 2014
1 parent 42fe55c commit 0cf929e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
10 changes: 3 additions & 7 deletions core-collapse.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@ Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/

:host {
html /deep/ core-collapse {
display: block;
}

:host(.core-collapse-closed) {
display: none !important;
}

.core-collapse-closed {
html /deep/ .core-collapse-closed {
display: none;
}
}
14 changes: 4 additions & 10 deletions core-collapse.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@

<link rel="import" href="../polymer/polymer.html">

<link rel="stylesheet" href="core-collapse.css" shim-shadowdom>

<polymer-element name="core-collapse" attributes="target horizontal opened duration fixedSize">
<template>

<link rel="stylesheet" polymer-scope="controller" href="core-collapse.css">
<link rel="stylesheet" href="core-collapse.css">

<content></content>

</template>
Expand Down Expand Up @@ -118,9 +117,6 @@
return;
}
this.isTargetReady = !!this.target;
if (this.target !== this) {
this.installControllerStyles();
}
this.classList.toggle('core-collapse-closed', this.target !== this);
this.target.style.overflow = 'hidden';
this.horizontalChanged();
Expand All @@ -131,12 +127,10 @@
},

addListeners: function(node) {
node.addEventListener('webkitTransitionEnd', this.transitionEndListener);
node.addEventListener('transitionend', this.transitionEndListener);
},

removeListeners: function(node) {
node.removeEventListener('webkitTransitionEnd', this.transitionEndListener);
node.removeEventListener('transitionend', this.transitionEndListener);
},

Expand All @@ -159,8 +153,7 @@

setTransitionDuration: function(duration) {
var s = this.target.style;
s.webkitTransition = s.transition = duration ?
(this.dimension + ' ' + duration + 's') : null;
s.transition = duration ? (this.dimension + ' ' + duration + 's') : null;
if (duration === 0) {
this.async('transitionEnd');
}
Expand All @@ -181,6 +174,7 @@

updateSize: function(size, duration, forceEnd) {
this.setTransitionDuration(duration);
this.calcSize();
var s = this.target.style;
var nochange = s[this.dimension] === size;
s[this.dimension] = size;
Expand Down

0 comments on commit 0cf929e

Please sign in to comment.