Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a declarative way to set applyAuthorStyles on a element's shadowRoot #106

Closed
sorvell opened this issue Apr 18, 2013 · 12 comments
Closed
Assignees

Comments

@sorvell
Copy link
Contributor

sorvell commented Apr 18, 2013

No description provided.

@sorvell
Copy link
Contributor Author

sorvell commented Jun 13, 2013

applyAuthorStyles may be set on the element's prototype.

@sorvell sorvell closed this as completed Jun 13, 2013
@ebidel
Copy link
Contributor

ebidel commented Sep 13, 2013

Opening this back up as we never came up with a declarative way.

My use case is <polymer-ui-submenu-item>. From a label attribute, it produces shadow dom that contains (<polymer-ui-menu-item>):

screen shot 2013-09-13 at 3 48 20 pm

I want to override stylings for that element, but can't with JS:

created: function() {
  this.$.menu.children.forEach(function(el, i) {
    if (el.localName == 'polymer-ui-submenu-item') {
      el.shadowRoot.applyAuthorStyles = true;
    }
  });
});

Instead, an attribute would be nice:

<polymer-ui-submenu-item label="Elements" apply-author-styles>
  <polymer-ui-menu-item>Polymer</polymer-ui-menu-item>
  <polymer-ui-menu-item>Test</polymer-ui-menu-item>
</polymer-ui-submenu-item>

Can <polymer-element> support a apply-author-styles attribute?

cc @frankiefu

@ebidel ebidel reopened this Sep 13, 2013
@ghost ghost assigned sorvell Sep 25, 2013
@sterrasi
Copy link

Has the declarative way been implemented. I would like to see that.

@jyasskin
Copy link

jyasskin commented Nov 3, 2013

Also, please be sure to document this when you implement it. Setting applyAuthorStyles on the prototype works, but isn't mentioned at http://www.polymer-project.org/polymer.html or http://www.polymer-project.org/docs/polymer/styling.html.

@ebidel
Copy link
Contributor

ebidel commented Nov 3, 2013

applyAuthorStyles is a shadow feature so it's not part of the core
reference. It's documented in my styling article:

http://www.polymer-project.org/articles/styling-elements.html#inheriting--resetting-outside-styles
On Nov 3, 2013 2:37 PM, "Jeffrey Yasskin" [email protected] wrote:

Also, please be sure to document this when you implement it. Setting
applyAuthorStyles on the prototype works, but isn't mentioned at
http://www.polymer-project.org/polymer.html or
http://www.polymer-project.org/docs/polymer/styling.html.


Reply to this email directly or view it on GitHubhttps://github.com//issues/106#issuecomment-27639364
.

@jyasskin
Copy link

jyasskin commented Nov 3, 2013

Ah, yes. I'd expected one of the reference pages to list the recognized fields of 'prototype', rather than leaving it to an introductory article.

@sjmiles
Copy link
Contributor

sjmiles commented Nov 3, 2013

Yes, the applyAuthorStyles is a feature of Polymer that enables that flag
for Polymer-created ShadowRoots. So I agree it should be listed as a
Polymer property (while the details of the actual effects can still be in
the ShadowRoot docs).

On Sun, Nov 3, 2013 at 8:18 AM, Jeffrey Yasskin [email protected]:

Ah, yes. I'd expected one of the reference pages to list the recognized
fields of 'prototype', rather than leaving it to an introductory article.


Reply to this email directly or view it on GitHubhttps://github.com//issues/106#issuecomment-27647712
.

@ebidel
Copy link
Contributor

ebidel commented Nov 3, 2013

Added these to the reference as well: Polymer/old-docs-site@8b744f8

@jyasskin
Copy link

jyasskin commented Nov 3, 2013

Thanks!

@ebidel
Copy link
Contributor

ebidel commented Feb 10, 2014

Can we close this now that applyAuthorStyles is gone? Has it been removed from Polymer?

@addyosmani
Copy link
Member

It's been removed from Polymer in googlearchive/polymer-dev@67ac33e. I would say it should be safe to remove.

@ebidel
Copy link
Contributor

ebidel commented Mar 16, 2014

Closing :)

@ebidel ebidel closed this as completed Mar 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants