polymer-core-rails icon indicating copy to clipboard operation
polymer-core-rails copied to clipboard

core-drawer-panel [drawer] styles not applied

Open tyler-dot-earth opened this issue 10 years ago • 7 comments

Hi alchapone! We exchanged some tweets, figured it'd probably be best to file an issue.

I'm having trouble with core-drawer-panel. Here are some observations that might help debug the problem:

Using this as an example: https://www.polymer-project.org/components/core-drawer-panel/demo.html Screenshot of the example (not of polymer-core-rails): screenshot from 2014-12-16 11 43 59

And implementing the exact code they have (including the blue/brown colors), here is my implementation using polymer-core-rails: screenshot from 2014-12-16 12 04 44

Take notice of the "Styles" tab in the Chrome Dev Tools! You'll notice that this particular CSS is never applied when using polymer-core-rails:

::content[select="[drawer]"] > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    -moz-box-sizing: border-box;
}

I thought that maybe this was a problem with the core-drawer-panel CSS file not working at all except that div[main] (from the same file) is styled fine. I then compared those style declarations and found some subtle differences:

This is how the [main] styling was applied:

polyfill-next-selector { content: '#main > [main]'; }
::content[select="[main]"] > * {
  height: 100%;
}

And this is how the [drawer] styling was applied:

polyfill-next-selector { content: ':host [drawer]'; }
::content[select="[drawer]"] > * {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  -moz-box-sizing: border-box;
}

So I tried changing it to this (to no success):

`polyfill-next-selector { content: '#drawer > [drawer]'; }`

I also attempted adding the shadow-shim attribute in the HTML file (as I'd seen it in other components) (also to no success): <link rel="stylesheet" href="core-drawer-panel.css" shim-shadowdom>

I'll update if I find any more information...

tyler-dot-earth avatar Dec 16 '14 19:12 tyler-dot-earth

I have exactly the same problem, and using the same example. The core-scaffold also has the same issue. Rails 3.2.13 here.

Frexuz avatar Dec 26 '14 01:12 Frexuz

@Frexuz I couldn't figure this out, so I switched to using Emcee/Bower. Here's an example project with a bit of documentation if you're interested: https://github.com/tsnieman/polyrails

tyler-dot-earth avatar Dec 26 '14 15:12 tyler-dot-earth

@tsnieman thanks, I'll try it out :)

Edit: Works now :) However just FYI, I'm having problems with other components. core-icon was missing some styles that I had to add manually, and paper-shadow wouldn't render the shadow on IOS.

Frexuz avatar Dec 26 '14 18:12 Frexuz

@Frexuz "core-icon was missing some styles" - which styles?

leolukin avatar Jan 04 '15 22:01 leolukin

//Missing core styles for some browsers
//http://stackoverflow.com/questions/27066400/polymer-icons-within-elements-not-rendering-in-firefox-or-safari-rails-app-with

core-icon-button {
  -moz-user-select: none;
  border-radius: 2px;
  box-sizing: border-box;
  cursor: pointer;
  display: inline-block;
  font-size: 1rem;
  margin: 2px;
  padding: 7px;
  vertical-align: middle;
}

html core-icon {
  background-repeat: no-repeat;
  display: inline-block;
  fill: currentcolor;
  height: 24px;
  position: relative;
  vertical-align: middle;
  width: 24px;
}

Frexuz avatar Jan 05 '15 01:01 Frexuz

So I tried emcee and whenever I require core-drawer-panel I just get a white screen. No errors in the console or from the server. Has anybody had this issue?

npezza93 avatar Jan 05 '15 22:01 npezza93

Someone told me the noscript attribute wasn't required. But removing it got me blank screens. Could this be the same issue for you?

Frexuz avatar Jan 06 '15 02:01 Frexuz