Questions tagged [polymer-3.x]
294 questions
5
votes
1 answer
lit-element passing data from one component to another
I am currently learning how to user lit-element v2.0.0-rc.2 I have two components app.js and list-items.js. In app.js I am collecting data from local storage and storing it in this.todoList, Im then calling this.todoList in my list-items.js but the…

DRW
- 335
- 1
- 3
- 17
5
votes
2 answers
Is it possible to split a Polymer 3 component into separated JavaScript, HTML, and CSS files?
I am trying to split a Polymer 3 component into separated files so for example:
import { html, PolymerElement } from '@polymer/polymer/polymer-element';
export default class TestSplit extends PolymerElement {
static get template() {
return…

Tibor Fekete
- 199
- 14
5
votes
1 answer
Polymer 3 upgrade - iron page selected is in dom but does not show
I am migrating my app from Polymer 1 to Polymer 3. I am starting off with the Polymer 3 sample app from polymer init. When I re-arrange the my-app.js(renamed to main-app.js) like my polymer 1 main-app.html, the selected iron page component doesn't…

dman
- 10,406
- 18
- 102
- 201
4
votes
2 answers
Polymer/Lit-element, child component doesn't re-render when the property is modified by the parent
live example
Basically:
I place the child component inside the parent's html.
The child component has a property title inside the static get properties() object.
In the parent component, i assign the child component's title property to a private…

dvolp
- 43
- 1
- 3
4
votes
2 answers
Polymer way of changing css using js
I am from angular, react background getting started with polymer.
I have a polymer class lets say myClass having this template.
Here x is property defined in property getter.
static get properties() {
return {
x:…

Divyanshu Rawat
- 4,421
- 2
- 37
- 53
4
votes
2 answers
How to load google font in LitElement
I am using LitElement and I am trying to load google-font at the element level.
I have tried returning it in an HTML literal in the connectedCallback event, but it does not work.
I could not manage to do it in the get styles() method.
Where should…

JoceM
- 53
- 1
- 5
4
votes
1 answer
LitElement load external script
I tried to simply load it in my rendered HTML but this does not work.
current code:
render() {
return html ``;
}

kannix
- 5,107
- 6
- 28
- 47
4
votes
0 answers
Opinions about mutation observer efficiency/reliability to automate dynamic imports
We have a new Lit-element based project and we are thinking of automate some things like dynamic imports. We already done this by implementing two main parts:
a watcher script checking changes (when serving locally) to ui components and writing to…

Alexandru Tomescu
- 83
- 1
- 10
4
votes
1 answer
How to use template-based elements in Polymer 2/3?
Certain elements, like iron-list, require template elements as children.
However, Polymer 3 strips templates of its content.
How are these seemingly conflicting principles supposed to work together?
See the jsbin examples @…

Nicholas Brandt
- 302
- 2
- 8
4
votes
1 answer
Running polymer-3.x test in headless browser
I want to run tests without the browser pop-up.Installed wct-headless and configured wct.config.json as shown
{
"plugins": {
"local": {
"disabled": true
},
"headless": {
"browsers": [
"chrome",
"firefox"
…

Raj
- 1,100
- 3
- 20
- 33
4
votes
1 answer
Passing a function as a parameter to child component polymer 3
I'm new to Polymer and stared learning it using a course called Polymer 3 - Code like a Google developer.
I would like to call the function: addContactClick() from the child component: side-menu.
To do that I have passed the function as an…

Ibrahim Shah Khan
- 43
- 7
4
votes
0 answers
Coverting Polymer 2 to Polymer 3: modulizer ran out of memory?
I'm trying to convert a Polymer 2 project to Polymer 3 using polymer-modulizer but I'm getting an error about running out of memory. What do I need to do to move forward?
I ran this command at the terminal:
modulizer me/my-repo --npm-version…

Let Me Tink About It
- 15,156
- 21
- 98
- 207
4
votes
3 answers
Typescript support for polymer v3
I am currently testing polymer 3 preview to see how to integrate it into our team workflow.
The recommended way to declare an element in v3 is:
import { PolymerElement } from '@polymer/polymer/polymer-element.js';
...
class MyElement extends…

Typing Tanuki
- 53
- 1
- 6
3
votes
2 answers
Importing web component without module bundler
I am trying to follow these instructions for using web components. I installed the polymer paper-button with npm install --save @polymer/paper-button, addded the below to my index.html and opened it with vscode's live-server. But I get a console…

Max888
- 3,089
- 24
- 55
3
votes
5 answers
CSS - Apply style to last element being not of a certain type
Question
I want to apply a style to the last child of an element that is NOT of a certain type.
Please do not confuse with: the last element IF it is not of a certain type.
Example

JDC
- 4,247
- 5
- 31
- 74