Styling Limitations

87 views
Skip to first unread message

Benjamin W Stookey

unread,
Jun 6, 2014, 10:10:36 PM6/6/14
to polym...@googlegroups.com
With the loss of apply-author-styles in Chrome 35, I'm seeing a lot of posts regarding broken css. Beyond bootstrap, however, I have a simpler and broader question. Excuse my ignorance, but I wonder how we can efficiently share styles at all across apps without the applyAuthoStyles flag assuming that some may use components and others not?

Maybe someone can explain the following logic from the bug report to me...?

^ and ^^ are explicit about what they match and give the author of the component control while applyAuthorStyles requires the author to worry about the internal structure of every nested 3rd party component just in case one of them uses applyAuthorStyles.

Is there any way to inherit natural styles within a component anymore (without including the css in every component), or do we have to assume that all css has to be prepared for components? applyAuthorStyles at least offered us the option to be defensive in our coding or not. I'm not seeing a choice anymore..

Rob Dodson

unread,
Jun 9, 2014, 4:42:11 PM6/9/14
to polym...@googlegroups.com
We're working on a solution to this problem but for the moment you'll have to use ::shadow and /deep/ to theme your components. FWIW, we're experimenting with a new element called core-style that may help with theming.

The issue with applyAuthorStyles is that selectors had to exactly match in order for a style to inherit. This lead to weird situations where some things were matching and others were not.

Benjamin W Stookey

unread,
Jun 10, 2014, 8:46:23 PM6/10/14
to polym...@googlegroups.com
Thanks for the response! The core-style element looks like an interesting workaround, I'll have to experiment with it.

Thank you for clarifying the issue. I found I had to be more explicit in my CSS for the things that weren't matching, but I can see the issue now. If you have time, can you provide any insight into what might be coming down the pipe on this? Will the core-style element be the way to go, or is there going to be some variant of applyAuthorStyles in a future version?

Rob Dodson

unread,
Jun 10, 2014, 9:46:26 PM6/10/14
to Benjamin W Stookey, polymer-dev
Unfortunately it's not a solved problem so we're still trying to find the best solution. `applyAuthorStyles` was one attempt, but it turned into a footgun. I can't say if `core-style` will be the golden path because we're still experimenting with it. Getting feedback from other developers like yourself is super valuable because it helps us prove out the ideas in lots of different contexts. So if you have the cycles, give it a shot and let us know where it's working and where you see rough edges.


On Tue, Jun 10, 2014 at 5:46 PM, Benjamin W Stookey <ben.s...@gmail.com> wrote:
Thanks for the response! The core-style element looks like an interesting workaround, I'll have to experiment with it.

Thank you for clarifying the issue. I found I had to be more explicit in my CSS for the things that weren't matching, but I can see the issue now. If you have time, can you provide any insight into what might be coming down the pipe on this? Will the core-style element be the way to go, or is there going to be some variant of applyAuthorStyles in a future version?

Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/d70c733f-2287-4f9c-9ee8-14b4c0e56558%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages