Skip to content

Commit 7c20fcf

Browse files
committed
docs: move "Content Security Policy" to the "Customization" section
1 parent 1626df3 commit 7c20fcf

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

packages/react-docs/config/sidebar-routes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ export const routes = [
3636
{ title: 'Color Style', path: 'getting-started/color-style' },
3737
{ title: 'Icons', path: 'getting-started/icons' },
3838
{ title: 'The sx prop', path: 'getting-started/the-sx-prop' },
39-
{ title: 'Security', path: 'getting-started/security' },
4039
{ title: 'Tonic UI Versions', path: 'getting-started/versions' },
4140
],
4241
},
@@ -67,6 +66,7 @@ export const routes = [
6766
<ToolsConfigurationIcon size="4x" {...props} />
6867
),
6968
routes: [
69+
{ title: 'Content Security Policy', path: 'customization/content-security-policy' },
7070
{ title: 'CSS Theme Variables', path: 'customization/css-theme-variables' },
7171
{ title: 'Shadow DOM', path: 'customization/shadow-dom' },
7272
],

packages/react-docs/pages/getting-started/security/index.page.mdx renamed to packages/react-docs/pages/customization/content-security-policy.page.mdx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Security
1+
# Content Security Policy
22

3-
## Content Security Policy
3+
Content Security Policy plays a critical role in protecting against various attacks, most notably Cross-Site Scripting (XSS) and data injections. Its core function involves the inclusion of either a `Content-Security-Policy` header in the HTTP response or `<meta>` tags within the HTML of a page.
44

5-
Content Security Policy (CSP) plays a critical role in protecting against various attacks, most notably Cross-Site Scripting (XSS) and data injections. Its core function involves the inclusion of either a `Content-Security-Policy` header in the HTTP response or `<meta>` tags within the HTML of a page.
5+
## Getting Started
66

7-
Tonic UI relies on [Emotion](https://emotion.sh/) for its styling system. To seamless integrate [Emotion](https://emotion.sh/) with CSP, it is essential to provide a `nonce` value to the `CacheProvider` component. Detailed instruction can be found in the [Emotion documentation](https://emotion.sh/docs/@emotion/cache).
7+
Tonic UI relies on [Emotion](https://emotion.sh/) for its styling system. To seamless integrate [Emotion](https://emotion.sh/) with Content Security Policy, it is essential to provide a `nonce` value to the `CacheProvider` component. Detailed instruction can be found in the [Emotion documentation](https://emotion.sh/docs/@emotion/cache).
88

99
### Step 1: Implement a `EmotionCacheProvider` component
1010

@@ -13,7 +13,11 @@ const EmotionCacheProvider = ({
1313
children,
1414
nonce,
1515
}) => {
16-
const cache = createCache({ key: 'tonic-ui', nonce });
16+
const cache = createCache({
17+
key: 'tonic-ui',
18+
nonce,
19+
});
20+
1721
return (
1822
<CacheProvider value={cache}>
1923
{children}

0 commit comments

Comments
 (0)