<style is="custom-style">
.center {
@apply(--layout-center);
}
.horizontal {
@apply(--layout-horizontal);
}
.vertical {
@apply(--layout-vertical);
}
</style>
<div class="horizontal center">On a somewhat related note, is there a reason the demos/docs are not in place for paper-styles in the new 1.0 element catalog? (https://elements.polymer-project.org/elements/paper-styles)Should I be using paper-styles, or is it experimental?
On Thursday, 16 July 2015 12:39:25 UTC-7, Kelly St. John wrote:Hi All,I'm currently in the midst of migrating an app built on polymer 0.5.4 to 1.0. In the 0.5 app I leveraged the core-style element throughout in order to apply common styling amongst the various custom elements. I'm not a CSS expert by any means (a relative newbie actually), and could really use an example of how to do the same using the new 1.0 styling paradigms. I like the idea of using a document-level element (via an external html file) to store application-level common styles. For instance, one would presume I could then place something like this in that document level external file:<style is="custom-style">.center {
@apply(--layout-center);
}.horizontal {
@apply(--layout-horizontal);
}.vertical {
@apply(--layout-vertical);
}
</style>
And use these document level styles by applying classes to any tag in the app, like:<div class="horizontal center">
However, that approach doesn't seem to be working at the moment.
I'm likely missing something with the scoping of CSS styles in Polymer 1.0, or maybe even barking down the wrong path entirely. I want to employ a theming strategy that will continue working as Polymer evolves beyond 1.0. I do not want to rewrite this application anytime soon...or it will likely be necessary for me to look for other employment. Can someone kindly point me in the right direction, please?Thanks
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/3759a8f4-2da7-4fca-b51a-77f57d2d8d8f%40googlegroups.com.
"One solution the Shadow DOM spec authors provided to address the theming problem are the /deep/ and::shadow combinators, which allow writing rules that pierce through the Shadow DOM encapsulation boundary. Although Polymer 0.5 promoted this mechanism for theming, it was ultimately unsatisfying for several reasons:
Using /deep/ and ::shadow for theming leaks details of an otherwise encapsulated element to the user, leading to brittle selectors piercing into the internal details of an element’s Shadow DOM that are prone to breakage when the internal implementation changes. As a result, the structure of of an element’s Shadow DOM inadvertently becomes API surface subject to breakage, diminishing the practical effectiveness of Shadow DOM as an encapsulation primitive.
Although Shadow DOM’s style encapsulation improves the predictability of style recalc performance since the side effects of a style change are limited to a small subset of the document, using /deep/ and::shadow re-opens the style invalidation area and reduces Shadow DOM’s effectiveness as a performance primitive.
Using /deep/ and ::shadow leads to verbose and difficult to understand selectors.
/deep/ and ::shadow altogether."To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/a071aece-1937-42fb-8d5c-c972a52c7b77%40googlegroups.com.
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/383d2fdc-5a94-43d6-966e-858bbb05a88b%40googlegroups.com.
Yes, the plan is to migrate all use of /deep/ and ::shadow in Polymer elements to custom properties, as it has been removed from the spec and as noted Chrome has posted deprecation warnings. The vast majority of that migration was already done during the 1.0 port and anything remaining should be vestigial at this point and should be cleaned up soon. I opened an issue for paper-slider; feel free to open issue on any other stragglers you find (a quick search didn't find any).
It is unlikely that Chrome will actually remove support for these combinators in the immediate future and the Shady DOM styling shim does support it for now so there is no immediate risk of breakage; however our team rule is to not rely on them going forward, and users obviously shouldn't either.