polymer-2.x

:host getting oveerirden by universal selector css

▼魔方 西西 提交于 2020-05-23 21:32:08
问题 We have CSS resets (margin:0px;padding:0px;) in a common style file which we have authored as one component and have included as a part of other components which we are developing. We are using universal selectors like below *,*:before,*:after{ color:pink } On each of our component we have a :host style with which we are trying to override this color :host{ color:yellow } As we expect :host to have more specificity over universal selector strangely this is not the case. universal selector

Does core Polymer 2.0 support two-way binding?

不问归期 提交于 2020-01-15 10:14:08
问题 I seem to be having trouble getting two-way binding to work with Polymer 2.0. I'm keeping things minimal, only using Polymer.Element. I define a parent component: <dom-module id="example1a-component"> <template> <xtal-fetch req-url="generated.json" result="{{myFetchResult}}"></xtal-fetch> <div>fetch result: <span>{{myFetchResult}}</span> </div> </template> <script> class Example1a extends Polymer.Element{ static get is(){return 'example1a-component'} static get properties(){ return {

How to style inner elements of custom Polymer element using external styles?

雨燕双飞 提交于 2020-01-11 09:32:31
问题 Unable to style an element using Shadow DOM with Polymer 1.x or 2.x. Consider the following custom element in Polymer 2.0: <link rel="import" href="../polymer/polymer.html"> <!-- `semantic-ui-button` @demo demo/index.html --> <dom-module id="polymer-button"> <template> <div class$="button {{size}}">{{label}}</div> </template> <script> class MyElement extends Polymer.Element { static get is() { return 'polymer-button'; } static get properties() { return { label: { type: String, value: 'polymer

How to style inner elements of custom Polymer element using external styles?

我们两清 提交于 2020-01-11 09:32:09
问题 Unable to style an element using Shadow DOM with Polymer 1.x or 2.x. Consider the following custom element in Polymer 2.0: <link rel="import" href="../polymer/polymer.html"> <!-- `semantic-ui-button` @demo demo/index.html --> <dom-module id="polymer-button"> <template> <div class$="button {{size}}">{{label}}</div> </template> <script> class MyElement extends Polymer.Element { static get is() { return 'polymer-button'; } static get properties() { return { label: { type: String, value: 'polymer

Importing Polymer web components from remote URLs

霸气de小男生 提交于 2020-01-06 04:41:21
问题 I have created a custom Polymer 2.0 based web component which aims to be installed on third-party websites in order to display content managed from my website. The web component in question depends on 3 other custom web components but also on iron-ajax , iron-dropdown , iron-icon , iron-icon-svg , marked-element and paper-icon-button . In order to maximize browsers compatibility, the code is transpiled to ES5 by using polymer-build with the default es5-bundled preset. Once done, the build

polymer-cli - getting “Can’t find variable: babelHelpers” when I set compile to true

廉价感情. 提交于 2020-01-04 13:10:34
问题 I use Polymer 2.0 and my build setting is: "builds": [ { "name": "bundled", "bundle": true, "js": { "compile": true}, "css": { "minify": true }, "html": { "minify": true } }] I get "Can’t find variable: babelHelpers" error after build. The Polymer CLI version that I use is 1.1.0. EDIT: I was using polymer-cli locally. After installing latest polymer-cli globally, now I get “Constructor requires ‘new’ operator” on safari and “Failed to construct ‘HTMLElement’: Please use the ‘new’ operator,

How to import custom fonts into an app or element using Polymer?

五迷三道 提交于 2020-01-04 05:43:30
问题 How does one import custom fonts into a Polymer app or element? Per @tweightman on the Polymer Slack Channel: <link rel="import" href="/bower_components/polymer/polymer-element.html"> <link rel="import" href="/bower_components/my-typography/my-typography.html"> <dom-module id="my-page-styles"> <template> <style include="my-typography"> :host { @apply --my-custom-font-mixin; } </style> </template> </dom-module> Stumbled across a possible solution: instead of using @font-face rules inside my

Polymer: Uncaught TypeError: Cannot read property 'persistent' of undefined

爱⌒轻易说出口 提交于 2020-01-03 02:23:14
问题 when I try to hide drawer in Login page it occur error. I use dom-if for hiding menubar and according to it's syntax I used <template> tag. But it occur error. Polymer code <!-- Drawer content --> <template is="dom-if" if="[[_isLogin()]]"> <app-drawer id="drawer" slot="drawer" swipe-open="[[narrow]]"> <app-toolbar>Menu</app-toolbar> <iron-selector selected="[[page]]" attr-for-selected="name" class="drawer-list" role="navigation"> <a name="homepage" href="[[rootPath]]homepage">Homepage</a> <a

In Polymer 2.0 how to observe edits to properties of an object bound to an element inside dom-repeat?

孤街醉人 提交于 2020-01-02 09:19:10
问题 (This question and code sample is for Polymer 2, but it's possible the same issue is present in 1.x) The Goal: I want to create an element (the Editor) that allows viewing/editing of the properties of certain types of objects, and another element (the List) that displays editable arrays of these objects, delegating the viewing/editing to the Editor element, while retaining control over the addition/removal of obejcts from the list. A to-do list is a good example of this (note: the Polymer to

Polymer- App Route with Sub Paging

ぃ、小莉子 提交于 2019-12-25 02:26:18
问题 ve read : https://www.polymer-project.org/2.0/toolbox/case-study#routing And: https://github.com/PolymerElements/app-route I think I am just confused how to use the subrouting component, but the documents and example I have read hasn't really gotten me anywhere. If anyone could point out the elephant in the room for me that would be great. What am I trying to Achieve? I have a list of items(called matters) which I display on my-matters.html (this page currently calls another custom element