Skip to content

Commit 7c4322d

Browse files
authored
Remove Caterpillar Custom Theme (#3903)
* remove caterpillar theme * Change files
1 parent 24b9aba commit 7c4322d

File tree

4 files changed

+11
-49
lines changed

4 files changed

+11
-49
lines changed

apps/fluent-tester/src/theme/CustomThemes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class TesterThemeReference extends ThemeReference {
4545
constructor() {
4646
super(
4747
baseTheme,
48-
(parent) => applyTheme(parent, this._themeName, this.options.appearance),
48+
() => applyTheme(this._themeName, this.options.appearance),
4949
(parent) => applyBrand(parent, this._brand),
5050
);
5151
this.baseTheme = baseTheme;

apps/fluent-tester/src/theme/applyTheme.ts

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,20 @@
1-
import type { PartialTheme, Theme, ThemeOptions } from '@fluentui-react-native/framework';
1+
import type { PartialTheme, ThemeOptions } from '@fluentui-react-native/framework';
22
import { createOfficeTheme, getThemingModule } from '@fluentui-react-native/win32-theme';
33

4-
export type ThemeNames = 'Default' | 'Office' | 'Caterpillar' | 'Apple';
4+
export type ThemeNames = 'Default' | 'Office' | 'Apple';
55

66
export const themeChoices = [
77
{ label: 'Default', value: 'Default' },
88
{ label: 'Office', value: 'Office' },
9-
{ label: 'Caterpillar', value: 'Caterpillar' },
109
];
1110

12-
function applyCaterpillarTheme(parent: Theme): PartialTheme {
13-
return parent.host?.appearance === 'dark'
14-
? {
15-
colors: {
16-
buttonBackground: '#111111',
17-
buttonBackgroundHovered: '#ffcd11',
18-
buttonBackgroundPressed: '#eeeeee',
19-
buttonText: '#ffffff',
20-
buttonTextPressed: '#111111',
21-
buttonTextHovered: '#000000',
22-
},
23-
components: {
24-
Button: {
25-
borderWidth: 0,
26-
tokens: {
27-
borderWidth: 0,
28-
},
29-
},
30-
},
31-
}
32-
: {
33-
colors: {
34-
buttonBackground: '#ffcd11',
35-
buttonBackgroundHovered: '#111111',
36-
buttonBackgroundPressed: '#eeeeee',
37-
buttonText: '#000000',
38-
buttonTextPressed: '#111111',
39-
buttonTextHovered: '#ffffff',
40-
},
41-
components: {
42-
Button: {
43-
borderWidth: 0,
44-
tokens: {
45-
borderWidth: 0,
46-
},
47-
},
48-
},
49-
};
50-
}
51-
5211
const themingModule = getThemingModule()[0];
5312

5413
/** apply the currently active theme layering */
55-
export function applyTheme(parent: Theme, name: ThemeNames, appearance: ThemeOptions['appearance']): PartialTheme {
14+
export function applyTheme(name: ThemeNames, appearance: ThemeOptions['appearance']): PartialTheme {
5615
switch (name) {
5716
case 'Office':
5817
return themingModule ? createOfficeTheme({ appearance, paletteName: 'Dialogs_FluentSV' }).theme : {};
59-
case 'Caterpillar':
60-
return applyCaterpillarTheme(parent);
6118
default:
6219
return {};
6320
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "remove caterpillar theme",
4+
"packageName": "@fluentui-react-native/tester",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

docs/pages/Theming/CustomTheme.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ const theme = new ThemeReference(createDefaultTheme(),
3333
</ThemeProvider>
3434
```
3535

36-
A good example of a custom theme from our repo is [the Caterpillar theme in the Tester App](../../../apps/fluent-tester/src/theme/applyTheme.ts).
37-
3836
### `ThemeReference` from scratch
3937

4038
You can create your own `ThemeReference` and pass it into the `ThemeProvider`. To create a `ThemeReference` you'll need to create a new instance of `ThemeReference`. You can find the type definition [here](../../../packages/framework/theme/src/themeReference.ts).

0 commit comments

Comments
 (0)