From fb20b501e877e2137831f9e86629e213007b88b7 Mon Sep 17 00:00:00 2001 From: mauroerta Date: Tue, 3 Aug 2021 00:28:39 +0200 Subject: [PATCH] feat: add theme removal --- apps/benchmarks/src/core/index.js | 2 +- apps/benchmarks/src/morfeo-vs/index.js | 2 +- apps/native-sandbox/src/App.tsx | 2 +- apps/svelte-sandbox/src/main.js | 4 +- .../src/components/ThemeToggle.test.tsx | 4 +- apps/web-sandbox/src/index.tsx | 8 +-- apps/web-sandbox/src/types.d.ts | 5 -- docs/docs/Packages/hooks.mdx | 4 +- docs/docs/Packages/preset-default.mdx | 20 +++++++ docs/docs/Packages/styled-components.mdx | 6 +- docs/docs/Packages/web.mdx | 8 +-- docs/package.json | 1 + .../HomepageFeatures/HomepageFeatures.js | 6 +- .../components/ThemeSelect/ThemeSelect.jsx | 28 ++++----- docs/src/theme/Root.js | 8 +-- packages/cli/src/utils/getCSSClasses.ts | 18 ++++-- packages/core/README.md | 4 +- packages/core/src/morfeo.ts | 58 ++++++++----------- packages/core/tests/morfeo.test.ts | 24 ++++---- packages/dev-tools/README.md | 4 +- packages/hooks/README.md | 6 +- packages/preset-default/package.json | 8 ++- .../preset-default/src/base/lightTheme.ts | 3 - packages/preset-default/src/index.ts | 17 +++++- packages/preset-default/tests/default.test.ts | 13 +++++ packages/spec/README.md | 8 +-- packages/styled-components-web/README.md | 4 +- packages/svelte/README.md | 16 ++--- packages/svelte/tests/morfeo.test.ts | 2 +- packages/web/README.md | 4 +- packages/web/src/utils/resetCss.ts | 2 +- 31 files changed, 173 insertions(+), 126 deletions(-) create mode 100644 docs/docs/Packages/preset-default.mdx delete mode 100644 packages/preset-default/src/base/lightTheme.ts create mode 100644 packages/preset-default/tests/default.test.ts diff --git a/apps/benchmarks/src/core/index.js b/apps/benchmarks/src/core/index.js index a7be4f9c..9d9dcbe5 100755 --- a/apps/benchmarks/src/core/index.js +++ b/apps/benchmarks/src/core/index.js @@ -5,7 +5,7 @@ const singleComplexPropertySuite = require('./singleComplexProperty'); const componentSuite = require('./componentStyle'); const completeStyleSuite = require('./completeStyle'); -morfeo.setTheme({ +morfeo.setTheme('default', { colors: { primary: 'black', secondary: 'white', diff --git a/apps/benchmarks/src/morfeo-vs/index.js b/apps/benchmarks/src/morfeo-vs/index.js index 0736e197..0b442d9e 100644 --- a/apps/benchmarks/src/morfeo-vs/index.js +++ b/apps/benchmarks/src/morfeo-vs/index.js @@ -2,6 +2,6 @@ const { morfeo } = require('@morfeo/core'); const defaultTheme = require('./theme'); const styledSystemSuite = require('./styled-system'); -morfeo.setTheme(defaultTheme); +morfeo.setTheme('default', defaultTheme); styledSystemSuite.run({ async: false }); diff --git a/apps/native-sandbox/src/App.tsx b/apps/native-sandbox/src/App.tsx index bac5d0e4..db76c294 100644 --- a/apps/native-sandbox/src/App.tsx +++ b/apps/native-sandbox/src/App.tsx @@ -8,7 +8,7 @@ import { Button } from './components'; LogBox.ignoreAllLogs(); -morfeo.setTheme(defaultTheme as any); +morfeo.setTheme('default', defaultTheme as any); const Box = styled.View