How to apply page css to a polymer component
Tags: html,css,css3,polymer
Problem :
I want my polymer component to use styles from 'normal' stylesheet. So I added shim-shadowdom to the style and /deep/ to the class, like this:
<html>
<head>
<style shim-shadowdom>
.mylink /deep/ {color: orange;}
<style>
</head>
<body>
<my-link></my-link>
</body>
</html>
and then component:
<polymer-element name="my-link">
<a class="mylink" href="#">xxx</a>
</polymer-element>
But this doesn't work neither in chrome - the link still has its usual color - no in ff and ie - the links are orange there, but they are orange even without /deep/ or shim-shadowdom.
The question - what am I doing wrong here?
Polymer version - 0.5.5.
PS: except styling, polymer works as expected - all components are shown up, ajax sends its requests and so on.
Solution :
You're going to need my-link /deep/ .mylink
Edit: Also, surround the <a>
with a <template>
element. Make sure your element is imported!
CSS Howto..
You have width: 92%; in there which would give you a border. Change that to 100% and use overflow:hidden elsewhere to handle the scrollbar problem.
You can run the search queries with the time code, then echo them after the search has finished with the time code coming first. $start = microtime(true); $searchdata = //Search...
If you are using class then you need to make sure your CSS is more specific to be applied. So li.active a won't work as it gets overridden by default...
<html> <head> <style type="text/css"> .title { color: blue; text-decoration: bold; text-size: 1em; } .author { color: gray; } </style> </head> <body> <p> <span class="title">La super bonne</span> <span class="author">proposée par Jérém</span>...
Since you are using display:inline-block to get side by side the li elements you can use this on your class t_s_li: .t_s_li { vertical-align:top; } The demo http://codepen.io/anon/pen/jHbBq For default...
change the following <div style="border-color:blue; height:200px; display:table-cell; vertical-align:middle;"> 2:38<img style="vertical-align:middle" src="images/stopwatch-button-play.png"> </div> ...
The most common way to do this is something along these lines: ul { list-style: none; padding:0; margin:0; } li { padding-left: 1em; text-indent: -.7em; } li:before { content: "•...
I'll try to explain the Bootstrap grid structure which I think will help you understand the problem. .col-xx-yy col = column selector xx (xs, sm, md, lg) = screen width...
You can add and remove classes that flip the div wrapping the two sides, by listening for the click event: html <div class="flip-container"> <div id="card" class="flipper"> <div class="front"> The front...
Aside from the Flex-box solution already mentioned you can simply use text-align:justify on the parent container like so: .container { background: #333; padding: 14px; font-size:0; text-align:justify; } .container div {...
If your menu view has the width set to 55%, you need to store the dp version of that percentage. "#main_menu": { width: "55%" } Device width: var width =...
You can change the part of it for: String selector = ""; if(hasBaseCls()){ selector += "." + getBaseCls(); } if(hasCls()){ selector += "." + getCls(); } if (hasName()) { selector...
If I got it right, you wanted a menu that slides to the left. What I changed: I changed the animation. I personally prefer animate the width of the window....
Just apply a padding (or a margin, depending on the style you've used) between elements, e.g. td a + a { padding-left: 3em; } ...
<material-input floatingLabel style="width:250px"> or <material-input class="foo" floatingLabel> and material-input.foo { width: 250px; } ...
Remove float:right from your input tag and apply width and inline-block for your labels. HTML <ul class="test"> <li> <label>Project Name</label><input type="text"/> </li> <li> <label>Project Launch Name</label><input type="text"/> </li> <li>...
You can use the CSS3 animation property. Just make sure to add the -webkit- vendor prefix for it to work in all major browsers. The vendor prefixes you need for...
I have the same question as you, but I have looked up in the code source of the Tootipsy web page... and finded how to do! Here is the javascript...
Use rotateX(), rotateY() or rotateZ() combined, like: .card:hover { transform: rotateX(60deg) rotateY(60deg) rotateZ(60deg); } Have a look at this snippet below: .card { background-image: url("https://i.stack.imgur.com/FW7wN.png"); height: 100px; margin: 50px auto;...
Just add this CSS rule to your logo image: #logo img {height: 100%;} See it here: http://codepen.io/anon/pen/GNJgJj...
Simply select the input field's wrapper <div> by it's CSS class for changing the text color. .input-field { color:orange; } Fiddle: https://jsfiddle.net/Lxx2k0fq/ For changing the placeholder text color see: Change...
There are multiple ways to achieve this, one would be to create an active state class for your favourite buttons and have this use the same styles as .fav:hover. Then...
This is what you are looking for. function formatImage(t) { //var t = document.getElementById("idOfImg"); alert(t.naturalWidth + " " + t.naturalHeight); t.height = t.naturalHeight; t.width = "200"; } On every image...
Try to add these rules to stack style class height: 13vw;vertical-align: super; your code will look like this <div class="large"> Fl<span class="fa-stack" style="width: 13vw; height:13vw; vertical-align: super;"><i class="fa fa-circle fa-stack-1x...
for responsive design use bootstrap plugin and its classes in your UI. refer link
If your HTML elements has two classes, like <div class="foo bar">, you can target it with two CSS class selectors combined: div.foo.bar { /* rules */ } Or, if you...
There are a few things wrong here. 1: Display: hide is invaild You mean to have display: none 2: Positioning. In order for elements to overlap each other, they need...
You could use the below. hr { width: auto; margin: 0 10px; /* This leaves 10px margin on left and right. If only right margin is needed try margin-right: 10px;...
You need to pass in a function like so: $('.my-class').each(function(){ fadeIn(this) }); So that this is referring to the .my-class element instead of the window...
You're looking for the jQuery animate() method (http://api.jquery.com/animate/). You set the scrollTop position you want to end with and the time it will take to reach it. Something like this:...