Skip to content

Commit 787acc6

Browse files
authored
Add example code and resulting screenshot for theme extension (#2261)
1 parent 367e7a4 commit 787acc6

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

docusaurus/docs/dev-docs/admin-panel-customization/options.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,3 +446,58 @@ To extend the theme, use either:
446446
:::strapi Strapi Design System
447447
The default [Strapi theme](https://github.com/strapi/design-system/tree/main/packages/design-system/src/themes) defines various theme-related keys (shadows, colors…) that can be updated through the `config.theme.light` and `config.theme.dark` keys in `./admin/src/app.js`. The [Strapi Design System](https://design-system.strapi.io/) is fully customizable and has a dedicated [StoryBook](https://design-system-git-main-strapijs.vercel.app) documentation.
448448
:::
449+
450+
<details>
451+
<summary>Example: Customizing some admin panel colors:</summary>
452+
453+
With the following code example, buttons and links that would use some primary colors will be displayed in red, as shown in the example screenshot:
454+
455+
<Tabs groupId="js-ts">
456+
457+
<TabItem value="js" label="JavaScript">
458+
459+
```tsx title="/src/admin/app.js"
460+
export default {
461+
config: {
462+
theme: {
463+
light: {
464+
colors: {
465+
primary600: "red",
466+
buttonPrimary500: "red",
467+
buttonPrimary600: "red",
468+
},
469+
},
470+
},
471+
},
472+
bootstrap() {},
473+
};
474+
```
475+
476+
</TabItem>
477+
478+
<TabItem value="ts" label="TypeScript">
479+
480+
```tsx title="/src/admin/app.ts"
481+
import type { StrapiApp } from "@strapi/strapi/admin";
482+
483+
export default {
484+
config: {
485+
theme: {
486+
light: {
487+
colors: {
488+
primary600: "red",
489+
buttonPrimary500: "red",
490+
buttonPrimary600: "red",
491+
},
492+
};
493+
},
494+
},
495+
bootstrap (app: StrapiApp) {},
496+
}
497+
```
498+
499+
</TabItem>
500+
</Tabs>
501+
502+
![Custom buttons in red](/img/assets/admin-panel-customization/red-login-button.png)
503+
</details>
36.1 KB
Loading

0 commit comments

Comments
 (0)