diff --git a/devtool/src/_shared/components/Slices/Components/Detail/index.tsx b/devtool/src/_shared/components/Slices/Components/Detail/index.tsx index 71ecdea5..5cd6c1a4 100644 --- a/devtool/src/_shared/components/Slices/Components/Detail/index.tsx +++ b/devtool/src/_shared/components/Slices/Components/Detail/index.tsx @@ -16,7 +16,7 @@ export const Detail = () => { const { devtoolConfig } = meta || {}; const [defaultStyleActive, setDefaultStyleActive] = useState(true); - const currentThemeName = morfeo.getCurrent(); + const currentThemeName = morfeo.getCurrentTheme(); const computedBackground = useMemo(() => { if (typeof devtoolConfig?.background === 'object') { diff --git a/devtool/src/_shared/components/Slices/Components/Preview.tsx b/devtool/src/_shared/components/Slices/Components/Preview.tsx index d8d8b2c3..1699ee19 100644 --- a/devtool/src/_shared/components/Slices/Components/Preview.tsx +++ b/devtool/src/_shared/components/Slices/Components/Preview.tsx @@ -43,7 +43,7 @@ export const Preview: React.FC = ({ name, variant }) => { const { navigate } = useRouter(); const { meta } = component(name, variant).get() || {}; - const currentThemeName = morfeo.getCurrent(); + const currentThemeName = morfeo.getCurrentTheme(); const { devtoolConfig } = meta || {}; const onClick = useCallback(() => { navigate(RouteName.COMPONENT, { diff --git a/devtool/src/_shared/template/Header/index.tsx b/devtool/src/_shared/template/Header/index.tsx index c358c4a5..7ee19ae3 100644 --- a/devtool/src/_shared/template/Header/index.tsx +++ b/devtool/src/_shared/template/Header/index.tsx @@ -9,7 +9,7 @@ import { RouteName } from '../../contexts'; export const Header: React.FC = () => { const { history, navigate, navigateBack } = useRouter(); const theme = useTheme(); - const [currentTheme, setCurrentTheme] = useState(morfeo.getCurrent()); + const [currentTheme, setCurrentTheme] = useState(morfeo.getCurrentTheme()); const canGoBack = history.length > 0; const themes = useMemo(() => (theme ? morfeo.getThemes() : {}), [theme]); const backButton = useMemo(() => { @@ -34,7 +34,7 @@ export const Header: React.FC = () => { value={currentTheme} placeholder={t('headerMyThemesPlaceholder')} onChange={value => { - morfeo.useTheme(value as ThemeName); + morfeo.setCurrentTheme(value as ThemeName); setCurrentTheme(value as ThemeName); }} options={Object.keys(themes).map(themeName => ({ diff --git a/devtool/src/_shared/utils/getThemeFromApp.ts b/devtool/src/_shared/utils/getThemeFromApp.ts index f9b5d78f..599ed7a5 100644 --- a/devtool/src/_shared/utils/getThemeFromApp.ts +++ b/devtool/src/_shared/utils/getThemeFromApp.ts @@ -25,7 +25,7 @@ function onMessageReceived(message: MorfeoDevToolAction) { themeNames.forEach(themeName => { morfeo.setTheme(themeName, themes[themeName] || {}); }); - morfeo.useTheme(current); + morfeo.setCurrentTheme(current); appendFonts(message); } diff --git a/docs/blog/2021-08-08-cli-and.presets.md b/docs/blog/2021-08-08-cli-and.presets.md index 808850a0..26845fda 100644 --- a/docs/blog/2021-08-08-cli-and.presets.md +++ b/docs/blog/2021-08-08-cli-and.presets.md @@ -1,6 +1,6 @@ --- slug: cli-and-presets -title: 🎉 Introducing CLI and Preset 🎉 +title: 🎉 Introducing CLI (Beta) and Preset 🎉 author: Mauro Erta author_title: Front End Engineer @ VLK STUDIO author_url: https://github.com/mauroerta @@ -10,7 +10,7 @@ tags: [cli, morfeo, design, system, preset] Today we are going to release 2 new features: -- a CLI that generates static CSS based on the theme +- a CLI that generates static CSS based on the theme (Beta version) - a theme preset to easily start using morfeo in 30 seconds (Many thanks to [Andrea](https://github.com/andreaSimonePorceddu) who made it possible) ### CLI diff --git a/docs/docs/Features/easy-to-test.mdx b/docs/docs/Features/easy-to-test.mdx index a8330e70..5f1668d9 100644 --- a/docs/docs/Features/easy-to-test.mdx +++ b/docs/docs/Features/easy-to-test.mdx @@ -52,7 +52,7 @@ test('should have the style defined inside the theme', () => { }); ``` -## Example 2 +## Example #2 The following component is used to switch the theme from light to dark and vice-versa: @@ -62,10 +62,10 @@ import { Theme, morfeo } from '@morfeo/react'; import { Button } from './Button'; export const ThemeToggle: React.FC = () => { - const [isLight, setIsLight] = useState(morfeo.getCurrent() === 'light'); + const [isLight, setIsLight] = useState(morfeo.getCurrentTheme() === 'light'); const onClick = useCallback(() => { - morfeo.useTheme(isLight ? 'dark' : 'light'); + morfeo.setCurrentTheme(isLight ? 'dark' : 'light'); setIsLight(!isLight); }, [isLight, light, dark]); @@ -98,7 +98,7 @@ beforeAll(() => { }); beforeEach(() => { - morfeo.useTheme('light', dark); + morfeo.setCurrentTheme('light', dark); }); test('should be light by default', () => { diff --git a/docs/docs/Features/multi-theming.mdx b/docs/docs/Features/multi-theming.mdx index c2100521..4548d453 100644 --- a/docs/docs/Features/multi-theming.mdx +++ b/docs/docs/Features/multi-theming.mdx @@ -24,17 +24,17 @@ After the themes are added, you can easily change the current theme by calling t ```typescript import { morfeo } from '@morfeo/core'; -morfeo.useTheme('light'); +morfeo.setCurrentTheme('light'); -console.log(morfeo.getCurrent()); // light; +console.log(morfeo.getCurrentTheme()); // light; -const style = morfeo.resove({ color: 'background' }); // {color: "#ffffff"}; +const style = morfeo.resolve({ color: 'background' }); // {color: "#ffffff"}; -morfeo.useTheme('dark'); +morfeo.setCurrentTheme('dark'); -console.log(morfeo.getCurrent()); // dark; +console.log(morfeo.getCurrentTheme()); // dark; -const style = morfeo.resove({ color: 'background' }); // {color: "#000000"}; +const style = morfeo.resolve({ color: 'background' }); // {color: "#000000"}; ``` ## Typescript diff --git a/docs/docs/Introduction/advantages.mdx b/docs/docs/Introduction/advantages.mdx index bb887554..b9764848 100644 --- a/docs/docs/Introduction/advantages.mdx +++ b/docs/docs/Introduction/advantages.mdx @@ -30,7 +30,7 @@ const dangerButtonStyle = morfeo.resolve({ corner: 'l', borderWidth: '2xs', // highlight-end - borderColor: 'errror.darkest', + borderColor: 'error.darkest', }); ``` diff --git a/docs/docs/Introduction/base-api.mdx b/docs/docs/Introduction/base-api.mdx index a8dbae93..aaf077a3 100644 --- a/docs/docs/Introduction/base-api.mdx +++ b/docs/docs/Introduction/base-api.mdx @@ -21,7 +21,7 @@ morfeo.setTheme('dark', darkTheme); /** * Set the theme to use (default is the first added) */ -morfeo.useTheme('dark'); +morfeo.setCurrentTheme('dark'); /** * Get the theme current theme @@ -35,7 +35,7 @@ morfeo.getTheme('light'); /** * Get the current theme name */ -const currentThemeName = morfeo.getCurrent(); // dark +const currentThemeName = morfeo.getCurrentTheme(); // dark /** * Get all the added themes diff --git a/docs/docs/Packages/core.mdx b/docs/docs/Packages/core.mdx index 820e5762..605ac5d9 100644 --- a/docs/docs/Packages/core.mdx +++ b/docs/docs/Packages/core.mdx @@ -26,19 +26,19 @@ yarn add @morfeo/core With the function **morfeo** you can handle the theme object and resolve a [morfeo style object](../ThemeSpecification/overview.mdx#morfeo-style-object) info a valid css-in-js object. :::note -[Here](https://github.com/VLK-STUDIO/morfeo/tree/main/packages/spec) you can find an explanation of the morfeo's theme specification; check it out to understand in deep all the properties your theme should have. +[Here](../ThemeSpecification/overview.mdx) you can find an explanation of the morfeo's theme specification; check it out to understand in deep all the properties your theme should have. ::: :::caution Warning -You'll probably never use _directly_ `@morfeo/core`, instead, you'll more likely to use [@morfeo/react](https://github.com/VLK-STUDIO/morfeo/tree/main/packages/react), [@morfeo/svelte](https://github.com/VLK-STUDIO/morfeo/tree/main/packages/svelte), [@morfeo/jss](https://github.com/VLK-STUDIO/morfeo/tree/main/packages/jss), or other packages that offer better integration of the morfeo eco-system in your framework of choice. +You'll probably never use _directly_ `@morfeo/core`, instead, you'll more likely to use [@morfeo/react](./react.mdx), [@morfeo/svelte](./svelte.mdx), [@morfeo/jss](./jss.mdx), or other packages that offer better integration of the morfeo eco-system in your framework of choice. In this particular case, it's important to know that you cannot define media queries as inline-style, that's why you need some other tool like JSS or Styled Components to handle this behavior. Likely, we already thought about it, so feel free to check out our packages. ::: ### handling the theme: set, use and get. -The `theme` handler is a singleton that will share across all your application/website the theme, so you can use it to refer colors, spacing, shadow (and [more..](https://github.com/VLK-STUDIO/morfeo/tree/main/packages/spec)), and most importantly the styles of your **components**. +The `theme` handler is a singleton that will share across all your application/website the theme, so you can use it to refer colors, spacing, shadow (and [more..](./ThemeSpecification/overview.mdx), and most importantly the styles of your **components**. This singleton is exported by `@morfeo` but, 99% of the time, you don't need to use it directly, `morfeo` exposes a set of methods that cover most of the common scenarios like `setting` one or more themes, `getting` the current theme, `using` a theme instead of another one. @@ -103,7 +103,7 @@ morfeo.setTheme('default', defaultTheme); /** * from now on your design language will be available across all your application */ -morfeo.useTheme('default'); +morfeo.setCurrentTheme('default'); ``` To use the theme in your application just use the `getTheme` method of the morfeo singleton: diff --git a/docs/docs/Packages/preset-default.mdx b/docs/docs/Packages/preset-default.mdx index 21bd187a..4520358f 100644 --- a/docs/docs/Packages/preset-default.mdx +++ b/docs/docs/Packages/preset-default.mdx @@ -52,9 +52,9 @@ If you like our themes, you can easily use them in your app with the `initPreset ```typescript import { initPreset } from '@morfeo/preset-default'; -morfeo.useTheme('light'); // Used by default +morfeo.setCurrentTheme('light'); // Used by default // OR -morfeo.useTheme('dark'); +morfeo.setCurrentTheme('dark'); ``` You can use these themes as they are or customize theme to fit your design: diff --git a/docs/sidebars.js b/docs/sidebars.js index 07bfadee..48f6cdd0 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -20,6 +20,8 @@ module.exports = { 'Features/single-source-of-truth', 'Features/multi-theming', 'Features/web-extension', + 'Features/extendible', + 'Features/easy-to-test', { type: 'category', label: '🔨 CLI (Beta)', @@ -30,8 +32,6 @@ module.exports = { 'Features/CLI/morfeo-cli-compose', ], }, - 'Features/extendible', - 'Features/easy-to-test', ], }, ], @@ -111,10 +111,4 @@ module.exports = { dirName: 'ThemeSpecification', }, ], - reactSidebar: [ - { - type: 'autogenerated', - dirName: 'React', - }, - ], }; diff --git a/docs/src/components/CodeExample/CodeExample.jsx b/docs/src/components/CodeExample/CodeExample.jsx index 1f41040f..2626d200 100644 --- a/docs/src/components/CodeExample/CodeExample.jsx +++ b/docs/src/components/CodeExample/CodeExample.jsx @@ -23,8 +23,8 @@ export function CodeExample() { }); const onClick = () => { - const current = morfeo.getCurrent(); - morfeo.useTheme(current === 'light' ? 'dark' : 'light') + const current = morfeo.getCurrentTheme(); + morfeo.setCurrentTheme(current === 'light' ? 'dark' : 'light') } return ( diff --git a/docs/src/components/ThemeSelect/ThemeSelect.jsx b/docs/src/components/ThemeSelect/ThemeSelect.jsx index cd31992a..c00b3f2e 100644 --- a/docs/src/components/ThemeSelect/ThemeSelect.jsx +++ b/docs/src/components/ThemeSelect/ThemeSelect.jsx @@ -48,7 +48,7 @@ export function ThemeSelect({ style: baseStyle }) { }); const applyTheme = name => { return () => { - morfeo.useTheme(name); + morfeo.setCurrentTheme(name); setSelected(name); }; }; diff --git a/examples/react/src/App.tsx b/examples/react/src/App.tsx index 07cbf1bb..1f3243ed 100644 --- a/examples/react/src/App.tsx +++ b/examples/react/src/App.tsx @@ -42,9 +42,9 @@ const Comps = () => { const [themeSymbol, setThemeSymbol] = useState('☽'); const toggleTheme = () => { - const current: any = morfeo.getCurrent(); + const current: any = morfeo.getCurrentTheme(); setThemeSymbol(current === 'light' ? '☼' : '☽'); - morfeo.useTheme(current === 'light' ? 'dark' : 'light'); + morfeo.setCurrentTheme(current === 'light' ? 'dark' : 'light'); }; return ( diff --git a/examples/react/src/index.tsx b/examples/react/src/index.tsx index afe1f072..3b08c56b 100644 --- a/examples/react/src/index.tsx +++ b/examples/react/src/index.tsx @@ -10,7 +10,7 @@ resetCss(); initPreset(); -morfeo.useTheme('light'); +morfeo.setCurrentTheme('light'); loadFont( { diff --git a/examples/svelte/src/components/ToggleTheme.svelte b/examples/svelte/src/components/ToggleTheme.svelte index 8fbafac0..89564804 100644 --- a/examples/svelte/src/components/ToggleTheme.svelte +++ b/examples/svelte/src/components/ToggleTheme.svelte @@ -5,7 +5,7 @@ let darkMode = false; function handleClick() { - morfeo.useTheme(darkMode ? 'light' : 'dark'); + morfeo.setCurrentTheme(darkMode ? 'light' : 'dark'); darkMode = !darkMode; } diff --git a/examples/svelte/src/main.js b/examples/svelte/src/main.js index 75525a42..77ab5a23 100644 --- a/examples/svelte/src/main.js +++ b/examples/svelte/src/main.js @@ -21,7 +21,7 @@ loadFont({ morfeo.setTheme('light', { ...lightTheme, components }); morfeo.setTheme('dark', { ...darkTheme, components }); -morfeo.useTheme('light'); +morfeo.setCurrentTheme('light'); const app = new App({ target: document.body, diff --git a/packages/core/README.md b/packages/core/README.md index bc35e0dc..133b93c1 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -118,7 +118,7 @@ morfeo.setTheme('default', defaultTheme); /** * from now on your design language will be available across all your application */ -morfeo.useTheme('default'); +morfeo.setCurrentTheme('default'); ``` To use the theme in your application just use the `getTheme` method of the morfeo singleton: diff --git a/packages/core/src/morfeo.ts b/packages/core/src/morfeo.ts index 9c00b435..d3ba4092 100644 --- a/packages/core/src/morfeo.ts +++ b/packages/core/src/morfeo.ts @@ -12,9 +12,9 @@ function createMorfeo() { * Get the current theme name * @example * - * const current = morfeo.getCurrent(); // "light" + * const current = morfeo.getCurrentTheme(); // "light" */ - function getCurrent(): ThemeName { + function getCurrentTheme(): ThemeName { return current; } @@ -41,9 +41,9 @@ function createMorfeo() { * * const button = document.querySelector("#theme-dark-switcher"); * - * button.addEventListener("click", () => morfeo.useTheme("dark")); + * button.addEventListener("click", () => morfeo.setCurrentTheme("dark")); */ - function useTheme(themeName: ThemeName) { + function setCurrentTheme(themeName: ThemeName) { const themeToBeUsed = themes[themeName]; if (!themeToBeUsed) { return false; @@ -65,13 +65,13 @@ function createMorfeo() { * morfeo.setTheme("light", { colors: { primary: "#DDFCAD" }, ...rest}); * morfeo.setTheme("dark", { colors: { primary: "#304F03" }, ...rest}); * - * morfeo.useTheme("light"); + * morfeo.setCurrentTheme("light"); * * console.log(morfeo.getTheme().colors.primary); // #DDFCAD * - * morfeo.useTheme("dark"); + * morfeo.setCurrentTheme("dark"); * - * console.log(morfeo.get().colors.primary); // #304F03 + * console.log(morfeo.getTheme().colors.primary); // #304F03 */ function setTheme( themeName: ThemeName, @@ -79,7 +79,7 @@ function createMorfeo() { ) { themes[themeName] = deepMerge(themes[themeName] || {}, newTheme) as Theme; if (!current || current === themeName) { - useTheme(themeName); + setCurrentTheme(themeName); } } @@ -128,11 +128,11 @@ function createMorfeo() { const instance = Object.freeze({ resolve, - useTheme, setTheme, getTheme, getThemes, - getCurrent, + getCurrentTheme, + setCurrentTheme, __dangerousReset, }); @@ -153,7 +153,7 @@ export type Morfeo = ReturnType; * * morfeo.setTheme("light", lightTheme); * - * morfeo.useTheme("light") + * morfeo.setCurrentTheme("light") * * const style = morfeo.resolve({ * py: "m", diff --git a/packages/core/tests/morfeo.test.ts b/packages/core/tests/morfeo.test.ts index 40d957f7..787a5899 100644 --- a/packages/core/tests/morfeo.test.ts +++ b/packages/core/tests/morfeo.test.ts @@ -29,7 +29,7 @@ describe('morfeo', () => { it('should return the current theme if no arguments are passed to `getTheme` method', () => { morfeo.setTheme('light' as ThemeName, LIGHT_THEME as any); - morfeo.useTheme('light' as ThemeName); + morfeo.setCurrentTheme('light' as ThemeName); expect(morfeo.getTheme().colors.primary).toBe(LIGHT_THEME.colors.primary); }); @@ -38,30 +38,30 @@ describe('morfeo', () => { morfeo.setTheme('light' as ThemeName, LIGHT_THEME as any); morfeo.setTheme('dark' as ThemeName, DARK_THEME as any); - morfeo.useTheme('light' as ThemeName); + morfeo.setCurrentTheme('light' as ThemeName); expect(morfeo.getTheme().colors.primary).toBe(LIGHT_THEME.colors.primary); - morfeo.useTheme('dark' as ThemeName); + morfeo.setCurrentTheme('dark' as ThemeName); expect(morfeo.getTheme().colors.primary).toBe(DARK_THEME.colors.primary); }); it("should return false if the theme name passed to `useTheme` it's not a valid theme name", () => { - expect(morfeo.useTheme('not a valid theme nme' as ThemeName)).toBe(false); + expect(morfeo.setCurrentTheme('not a valid theme nme' as ThemeName)).toBe(false); }); it('should parse the style object based on the current theme', () => { morfeo.setTheme('light' as ThemeName, LIGHT_THEME as any); morfeo.setTheme('dark' as ThemeName, DARK_THEME as any); - morfeo.useTheme('light' as ThemeName); + morfeo.setCurrentTheme('light' as ThemeName); expect(morfeo.resolve({ bg: 'primary' })).toEqual({ backgroundColor: LIGHT_THEME.colors.primary, }); - morfeo.useTheme('dark' as ThemeName); + morfeo.setCurrentTheme('dark' as ThemeName); expect(morfeo.resolve({ bg: 'primary' })).toEqual({ backgroundColor: DARK_THEME.colors.primary, @@ -70,9 +70,9 @@ describe('morfeo', () => { it('should get the current theme name', () => { morfeo.setTheme('light' as ThemeName, LIGHT_THEME as any); - morfeo.useTheme('light' as ThemeName); + morfeo.setCurrentTheme('light' as ThemeName); - expect(morfeo.getCurrent()).toBe('light'); + expect(morfeo.getCurrentTheme()).toBe('light'); }); it('should get all the added themes', () => { diff --git a/packages/dev-tools/src/index.ts b/packages/dev-tools/src/index.ts index 50f9fa2d..30828faf 100644 --- a/packages/dev-tools/src/index.ts +++ b/packages/dev-tools/src/index.ts @@ -8,7 +8,7 @@ function onChange(newTheme: Theme) { type: MORFEO_DEVTOOLS, theme: newTheme, themes: morfeo.getThemes(), - current: morfeo.getCurrent(), + current: morfeo.getCurrentTheme(), }, '*', ); diff --git a/packages/dev-tools/tests/enable.test.ts b/packages/dev-tools/tests/enable.test.ts index c007de84..d269a2f6 100644 --- a/packages/dev-tools/tests/enable.test.ts +++ b/packages/dev-tools/tests/enable.test.ts @@ -18,7 +18,7 @@ describe('enableMorfeoDevTool', () => { primary: 'dark primary', }, }); - morfeo.useTheme('default'); + morfeo.setCurrentTheme('default'); }); test('should call the window.postMessage callback when the function is called', () => { @@ -32,7 +32,7 @@ describe('enableMorfeoDevTool', () => { test('should call the window.postMessage callback when the theme change', () => { const spyPostMessage = jest.spyOn(window, 'postMessage'); - morfeo.useTheme('light' as ThemeName); + morfeo.setCurrentTheme('light' as ThemeName); expect(spyPostMessage).toHaveBeenCalled(); }); diff --git a/packages/hooks/tests/useTheme.test.ts b/packages/hooks/tests/useTheme.test.ts index ae688255..66c427ee 100644 --- a/packages/hooks/tests/useTheme.test.ts +++ b/packages/hooks/tests/useTheme.test.ts @@ -15,7 +15,7 @@ const THEME = { beforeAll(() => { morfeo.setTheme('default', THEME); - morfeo.useTheme('default'); + morfeo.setCurrentTheme('default'); }); describe('useTheme', () => { diff --git a/packages/preset-default/README.md b/packages/preset-default/README.md index 66921220..0e9c6bde 100644 --- a/packages/preset-default/README.md +++ b/packages/preset-default/README.md @@ -54,9 +54,9 @@ If you like our themes, you can easily use them in your app with the `initPreset ```typescript import { initPreset } from '@morfeo/preset-default'; -morfeo.useTheme('light'); // Used by default +morfeo.setCurrentTheme('light'); // Used by default // OR -morfeo.useTheme('dark'); +morfeo.setCurrentTheme('dark'); ``` You can use these themes as they are or customize theme to fit your design: diff --git a/packages/preset-default/tests/default.test.ts b/packages/preset-default/tests/default.test.ts index de8a0ef7..977da5c9 100644 --- a/packages/preset-default/tests/default.test.ts +++ b/packages/preset-default/tests/default.test.ts @@ -7,7 +7,7 @@ describe('preset-default', () => { }); it('should set the current theme equals to light', () => { - expect(morfeo.getCurrent()).toEqual('light'); + expect(morfeo.getCurrentTheme()).toEqual('light'); }); it('should have set 2 themes, dark and light', () => { diff --git a/packages/react/tests/MorfeoComponent.test.tsx b/packages/react/tests/MorfeoComponent.test.tsx index 6cd8a2d9..95c2e347 100644 --- a/packages/react/tests/MorfeoComponent.test.tsx +++ b/packages/react/tests/MorfeoComponent.test.tsx @@ -34,7 +34,7 @@ morfeo.setTheme('default', theme); describe('MorfeoComponent', () => { beforeAll(() => { - morfeo.useTheme('default'); + morfeo.setCurrentTheme('default'); }); test('should create a button with initial style and props based on the theme', async () => { diff --git a/packages/react/tests/useClassName.test.tsx b/packages/react/tests/useClassName.test.tsx index a118aa0e..79025296 100644 --- a/packages/react/tests/useClassName.test.tsx +++ b/packages/react/tests/useClassName.test.tsx @@ -13,7 +13,7 @@ const theme = { morfeo.setTheme('default', theme); beforeEach(() => { - morfeo.useTheme('default'); + morfeo.setCurrentTheme('default'); }); test('should apply the style with the className generated by `useClassName`', async () => { diff --git a/packages/react/tests/useStyles.test.tsx b/packages/react/tests/useStyles.test.tsx index 004c152f..52909476 100644 --- a/packages/react/tests/useStyles.test.tsx +++ b/packages/react/tests/useStyles.test.tsx @@ -12,7 +12,7 @@ const theme = { morfeo.setTheme('default', theme); beforeEach(() => { - morfeo.useTheme('default'); + morfeo.setCurrentTheme('default'); }); test('should generate the correct style with the override of `useStyle`', async () => { diff --git a/packages/web/tests/loadFont.test.ts b/packages/web/tests/loadFont.test.ts index 3fb785fc..e0973b10 100644 --- a/packages/web/tests/loadFont.test.ts +++ b/packages/web/tests/loadFont.test.ts @@ -26,7 +26,7 @@ beforeEach(() => { morfeo.__dangerousReset(); morfeo.setTheme('light' as ThemeName, { fonts: {} }); morfeo.setTheme('dark' as ThemeName, { fonts: {} }); - morfeo.useTheme('light' as ThemeName); + morfeo.setCurrentTheme('light' as ThemeName); }); describe('loadFont', () => {