Skip to content

Commit 76053d7

Browse files
docs(pie-cookie-banner): DSW-2679 add a CDN usage block to readme (#2279)
1 parent 213880c commit 76053d7

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

.changeset/swift-buckets-press.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@justeattakeaway/pie-cookie-banner": patch
3+
---
4+
5+
[Added] - CDN readme

packages/components/pie-cookie-banner/README.md

+24
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,30 @@ yarn add @justeattakeaway/pie-cookie-banner
3030

3131
For full information on using PIE components as part of an application, check out the [Getting Started Guide](https://github.com/justeattakeaway/pie/wiki/Getting-started-with-PIE-Web-Components).
3232

33+
## CDN Usage
34+
35+
This is not the recommended way to use the component. However, it may be appropriate for some consumers if they are unable to install the package into their application.
36+
37+
Example (without typography) can be seen in this [Codepen](https://codepen.io/JamieMaguire/pen/emYGwgy)
38+
39+
To check for the most up-to-date versions of our cookie banner and css, check their npm pages [here](https://www.npmjs.com/package/@justeattakeaway/pie-cookie-banner) and [here](https://www.npmjs.com/package/@justeattakeaway/pie-css). It is important to stay up to date. These will be the versions you use in the CDN links.
40+
41+
### Setup
42+
43+
1. Please add the `pie-css` stylesheet to your application. This can be imported from our CDN like so:
44+
45+
```html
46+
<link rel="stylesheet" href="https://pie-design-system-cdn.production.jet-external.com/pie-css/v0.16.0/index.css">
47+
```
48+
49+
2. Now you can add the Cookie Banner script to your application. This can also be imported from our CDN like so:
50+
51+
```html
52+
<script src="https://pie-design-system-cdn.production.jet-external.com/pie-cookie-banner/1.3.0/index.js"></script>
53+
```
54+
55+
We would recommend placing this script somewhere in the bottom of your HTML body tag. However what works for each application will be different. Please consider how this could affect the loading of your page.
56+
3357
## Documentation
3458

3559
Visit [Cookie Banner | PIE Design System](https://pie.design/patterns/cookie-banner/code/) to view more information on this component.

0 commit comments

Comments
 (0)