Skip to content

Commit d9fc4fb

Browse files
committed
Add useAdoptedStyleSheetsWithBuiltCSS section.
1 parent fe696f1 commit d9fc4fb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

CHANGELOG.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
## Unreleased
44

5-
### New global behaviors
6-
7-
#### Built Shady CSS styles automatically use constructable stylesheet objects
8-
9-
If your application is uses pre-built Shady CSS styles and your browser supports [constructable stylesheet objects](https://wicg.github.io/construct-stylesheets/), Polymer will now extract all styles from your components' templates, join them into a single stylesheet, and share this stylesheet with all instances of the component using [`adoptedStyleSheets`](https://wicg.github.io/construct-stylesheets/#dom-documentorshadowroot-adoptedstylesheets).
10-
115
### New global settings
126

137
This update to Polymer includes some new [global settings](https://polymer-library.polymer-project.org/3.0/docs/devguide/settings):
@@ -167,6 +161,12 @@ This update to Polymer includes some new [global settings](https://polymer-libra
167161

168162
**Should I use it?** This setting should only be used if startup time is significantly affected by Polymer's class initialization work - for example, if you have a large number of components being loaded but are only instantiating a small subset of them. Otherwise, this setting is **not recommended**.
169163

164+
- `useAdoptedStyleSheetsWithBuiltCSS` / `setUseAdoptedStyleSheetsWithBuiltCSS`
165+
166+
**What does it do?** If your application is uses [pre-built Shady CSS styles](https://github.com/polymer/polymer-css-build) and your browser supports [constructable stylesheet objects](https://wicg.github.io/construct-stylesheets/), this setting will cause Polymer to extract all `<style>` elements from your components' templates, join them into a single stylesheet, and share this stylesheet with all instances of the component using their shadow roots' [`adoptedStyleSheets`](https://wicg.github.io/construct-stylesheets/#dom-documentorshadowroot-adoptedstylesheets) array. This setting may improve your components' memory usage and performance depending on how many instances you create and how large their style sheets are.
167+
168+
**Should I use it?** Consider using this setting if your app already uses pre-built Shady CSS styles. Note that position-dependent CSS selectors (e.g. containing `:nth-child()`) may become unreliable for siblings of your components styles as a result of runtime-detected browser support determining if styles are removed from your components' shadow roots.
169+
170170
### Other new features
171171

172172
#### `<dom-repeat>`

0 commit comments

Comments
 (0)