Skip to content

Commit c313e1a

Browse files
committed
Improvements to README
1 parent 8169388 commit c313e1a

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,20 @@ A small (9 kB compressed) polyfill for CSS Container Queries using [`ResizeObser
66
- Range queries (`200px < width < 400px` and `width < 400px`)
77
- Container relative length units (`cqw`, `cqh`, `cqi`, `cqb`, `cqmin`, and `cqmax`) in properties and keyframes
88

9+
## Browser Support
10+
11+
* Firefox 69+
12+
* Chrome 79+
13+
* Edge 79+
14+
* Safari 13.4+
15+
16+
917
## Getting Started
1018

11-
To use the polyfill, add this script tag to the head of your document: :
19+
To use the polyfill, add this script tag to your document `<head>`:
1220

1321
```js
14-
<script type="module">
22+
<script>
1523
if (!("container" in document.documentElement.style)) {
1624
import("https://unpkg.com/container-query-polyfill@^0.2.0");
1725
}
@@ -41,12 +49,12 @@ For the best user experience, it's recommended that you initially only use the p
4149
You can view a more complete demo [here](https://codesandbox.io/s/smoosh-glitter-m2ub4w?file=/index.html). On sufficiently fast networks and devices, or devices that natively support Container Queries, this loading indicator will never be displayed.
4250

4351
> **Note**
44-
> Keep in mind that this technique effectively trades off LCP for less jank during initial load, so you may see regressions in the former as a result, particularly on low end devices.
52+
> Keep in mind that this technique effectively limits impact on FID and CLS, potentially at the expense of LCP. You may see regressions in the latter as a result, particularly on lower end devices or in poor network conditions.
4553
4654
## Limitations
4755

48-
- **CSS first**: The polyfill currently only supports `<style>` and `<link>` elements. Inline styles via the `style` attribute or CSSOM methods are not polyfilled. Likewise, JavaScript APIs like `CSSContainerRule` are not polyfilled, and APIs like `CSS.supports()` are not monkey-patched.
49-
- **Best effort**: Style changes that do not lead to observable DOM or layout mutations (e.g. `font-size` in a container without content) may not be detected, or may be detected a frame late on some browsers.
56+
- **CSS first**: The polyfill currently only supports `<style>` and same-origin `<link>` elements. Inline styles via the `style` attribute or CSSOM methods are not polyfilled. Likewise, JavaScript APIs like `CSSContainerRule` are not polyfilled, and APIs like `CSS.supports()` are not monkey-patched.
57+
- **Best effort**: Style changes that do not lead to observable DOM or layout mutations (e.g. changing `font-size` in a container without content) may not be detected, or may be detected a frame late on some browsers.
5058
- Currently, there is no support for Shadow DOM, or functions like `calc(...)` in container conditions. Your contribution would be welcome!
5159

5260
## Supporting browsers without `:where()`
@@ -122,3 +130,7 @@ This is to ensure the specificity of your rules never changes (e.g. while the po
122130
## ResizeObserver Loop Errors
123131

124132
When using the polyfill, you may observe reports of errors like `ResizeObserver loop completed with undelivered notifications` or `ResizeObserver loop limit exceeded`. These are expected, and may safely be ignored.
133+
134+
## License
135+
136+
[Apache 2.0](LICENSE)

0 commit comments

Comments
 (0)