Skip to content

Commit 62946a7

Browse files
author
Hugo Bernier
committed
Updated readme and deployment instructions.
1 parent 1acab4b commit 62946a7

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ __Note__: This code is provided as a sample only. Keep in mind that Microsoft ma
99

1010
When you need to make minor cosmetic changes to modern pages (e.g.: match your corporate branding guidelines) and cannot use placeholders,you can create a custom CSS and inject on every modern page.
1111

12+
In this example, we deploy the CSS in a shared location; this allows us to change the CSS file at any time without re-deploying or re-configuring the application customizer.
13+
14+
You can deploy the application customizer with different settings to point to different CSS files.
15+
1216

1317
## Used SharePoint Framework Version
1418

@@ -62,6 +66,15 @@ Version|Date|Comments
6266
* update _serve.json_ pointing to your site collection home page change the `cssurl` property with the URL to your custom CSS.
6367
* run _gulp serve_
6468

69+
## Deployment to Production
70+
71+
* located the `elements.xml` file, in the `sharepoint` > `assets` folder
72+
* change the `ClientSideComponentProperties` to point to your custom CSS URL.
73+
* run _gulp bundle --ship_
74+
* run _gulp package-solution --ship_
75+
* upload the `react-application-injectcss.sppkg` from the `sharepoint` folder to your App catalog.
76+
* when prompted to deploy to all sites, choose the option that suits your needs.
77+
6578
## Features
6679

6780
Sample SharePoint Framework application customiser injecting a custom CSS in the HTML header.

sharepoint/assets/elements.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
3+
4+
<CustomAction
5+
Title="InjectCssApplicationCustomizer"
6+
Location="ClientSideExtension.ApplicationCustomizer"
7+
ClientSideComponentId="fcea9230-7f22-45b7-815c-081a49474611"
8+
ClientSideComponentProperties="{&quot;cssurl&quot;:&quot;/Style%20Library/custom.css&quot;}">
9+
10+
</CustomAction>
11+
12+
</Elements>

0 commit comments

Comments
 (0)