Skip to content

Commit

Permalink
fix: feedback ac for direct import if three shaking is not working
Browse files Browse the repository at this point in the history
  • Loading branch information
matthprost committed Sep 23, 2024
1 parent 173b560 commit e8e1b5e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
3 changes: 2 additions & 1 deletion packages/themes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ $ pnpm add @ultraviolet/ui @ultraviolet/themes @emotion/react @emotion/styled

```js
import { normalize, Button } from '@ultraviolet/ui'
import { consoleDarkTheme } from '@ultraviolet/themes' // << Here we import the theme we want to use
import { consoleDarkTheme } from '@ultraviolet/themes' // Here we import the theme we want to use
// import { consoleLightTheme } from "@ultraviolet/themes/console/light" // Alternatively you can directly import the light theme if your bundler doesn't have tree-shaking capabilities
import { Global, css, ThemeProvider } from '@emotion/react'

const App = () => (
Expand Down
5 changes: 5 additions & 0 deletions packages/themes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
"types": "./dist/index.d.ts",
"require": "./dist/index.cjs",
"default": "./dist/index.js"
},
"./console/*": {
"types": "./dist/themes/console/index.d.ts",
"require": "./dist/themes/console/index.cjs",
"default": "./dist/themes/console/index.js"
}
},
"dependencies": {
Expand Down
6 changes: 2 additions & 4 deletions packages/themes/src/themes/console/dark/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@ import deepmerge from 'deepmerge'
import { deprecatedDarkTokens } from '../deprecated/dark'
import { darkTheme } from './__generated__'

export const consoleDarkTheme = deepmerge(
darkTheme,
deprecatedDarkTokens,
) as typeof darkTheme & typeof deprecatedDarkTokens
export const consoleDarkTheme: typeof darkTheme & typeof deprecatedDarkTokens =
deepmerge(darkTheme, deprecatedDarkTokens)
6 changes: 2 additions & 4 deletions packages/themes/src/themes/console/darker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@ import deepmerge from 'deepmerge'
import { deprecatedDarkerTokens } from '../deprecated/darker'
import { darkerTheme } from './__generated__'

export const consoleDarkerTheme = deepmerge(
darkerTheme,
deprecatedDarkerTokens,
) as typeof darkerTheme & typeof deprecatedDarkerTokens
export const consoleDarkerTheme: typeof darkerTheme &
typeof deprecatedDarkerTokens = deepmerge(darkerTheme, deprecatedDarkerTokens)
6 changes: 2 additions & 4 deletions packages/themes/src/themes/console/light/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@ import deepmerge from 'deepmerge'
import { deprecatedLightTokens } from '../deprecated/light'
import { lightTheme } from './__generated__'

export const consoleLightTheme = deepmerge(
lightTheme,
deprecatedLightTokens,
) as typeof lightTheme & typeof deprecatedLightTokens
export const consoleLightTheme: typeof lightTheme &
typeof deprecatedLightTokens = deepmerge(lightTheme, deprecatedLightTokens)

0 comments on commit e8e1b5e

Please sign in to comment.