Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit 3990c8f

Browse files
committed
fix(wip-styled): use emotion theme provider
1 parent 5e675e1 commit 3990c8f

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

packages/styled/src/theming.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ let createCacheWithTheme = /* #__PURE__ */ weakMemoize(outerTheme => {
1717
function EmotionThemeProvider (theme: object | ((Obj: object) => Object)) {
1818
let _theme = useEmotionTheme()
1919
if (theme !== _theme) {
20+
// @ts-ignore
2021
_theme = createCacheWithTheme(_theme)(theme)
2122
}
2223
_EmotionThemeProvider(_theme)

packages/styled/tests/__snapshots__/styled.test.tsx.snap

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ exports[`styled composition 2`] = `
155155
156156
<h1
157157
class="legacy__class emotion-0"
158-
scale="2"
159158
>
160159
hello world final
161160
</h1>
@@ -203,7 +202,6 @@ exports[`styled function in expression 1`] = `
203202
204203
<h1
205204
class="legacy__class emotion-0"
206-
scale="2"
207205
>
208206
hello world
209207
</h1>
@@ -226,8 +224,6 @@ exports[`styled glamorous style api & composition 1`] = `
226224
227225
<h1
228226
class="emotion-0"
229-
flex="1"
230-
fontsize="20"
231227
>
232228
hello world
233229
</h1>
@@ -255,7 +251,6 @@ exports[`styled handles more than 10 dynamic properties 1`] = `
255251
256252
<h1
257253
class="legacy__class emotion-0"
258-
theme="[object Object]"
259254
>
260255
hello world
261256
</h1>
@@ -490,7 +485,6 @@ exports[`styled objects 1`] = `
490485
491486
<h1
492487
class="emotion-0"
493-
display="flex"
494488
>
495489
hello world
496490
</h1>
@@ -522,16 +516,16 @@ exports[`styled prop filtering 1`] = `
522516
<a
523517
a="true"
524518
aria-label="some label"
519+
arialabel="some label"
525520
b="true"
526521
class="emotion-0"
527522
cool="true"
528523
data-wow="value"
524+
datawow="value"
529525
filtering="true"
530526
href="link"
531527
is="true"
532-
m="3"
533528
prop="true"
534-
pt="4"
535529
wow="true"
536530
>
537531
hello world

packages/test-utils/src/render.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { ComponentOptions } from "@vue/runtime-core"
21
import theme from "@chakra-ui/vue-theme"
2+
import { EmotionThemeContextSymbol } from "@chakra-ui/vue-styled"
33
import "@testing-library/jest-dom"
44
import "@testing-library/jest-dom/extend-expect"
55
import * as vtl from "@testing-library/vue"
@@ -14,6 +14,7 @@ const useDefaultProviders = () => {
1414
provide("$chakraTheme", theme)
1515
provide("$chakraColorMode", "light")
1616
provide("$chakraIcons", {})
17+
provide(EmotionThemeContextSymbol, theme)
1718
}
1819

1920
export type TestRenderProps = {

0 commit comments

Comments
 (0)