@@ -16,16 +16,15 @@ the `ThemeProvider`'s scope can access this theme object.
1616::: demo
1717
1818``` vue
19-
2019<script setup lang="ts">
21- import { styled, ThemeProvider } from '@vue3-styled-components/package'
20+ import { styled, ThemeProvider } from '@vue3-styled-components/package'
2221
23- const StyledWrapper = styled.div`
24- display: flex;
25- justify-content: space-around;
26- `
22+ const StyledWrapper = styled.div`
23+ display: flex;
24+ justify-content: space-around;
25+ `
2726
28- const StyledLink = styled.a`
27+ const StyledLink = styled.a`
2928 margin-right: 8px;
3029 color: ${(props) => props.theme.primary} !important;
3130 font-weight: bold;
@@ -54,42 +53,40 @@ and see the updates reflected in your styled components.
5453::: demo
5554
5655``` vue
57-
5856<script setup lang="ts">
59- import { styled, ThemeProvider } from '@vue3-styled-components/package'
60- import { ref } from 'vue'
61-
62- const theme = ref<Record<string, string>>({ primary: 'blue' })
63-
64- const StyledWrapper = styled.div`
65- display: flex;
66- justify-content: space-between;
67- align-items: center;
68- `
69-
70- const StyledLink = styled.a`
71- color: ${(props) => props.theme.primary} !important;
72- `
73-
74- const StyledButton = styled.button`
75- width: 140px;
76- height: 36px;
77- margin-left: 20px;
78- padding: 4px 12px;
79- border-radius: 9999px;
80- box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
81- background-color: skyblue;
82- font-weight: bold;
83- `
84-
85- const changeTheme = () => {
86- if (theme.value.primary === 'red') {
87- theme.value.primary = 'blue'
88- } else {
89- theme.value.primary = 'red'
90- }
91- }
57+ import { styled, ThemeProvider } from '@vue3-styled-components/package'
58+ import { ref } from 'vue'
59+
60+ const theme = ref<Record<string, string>>({ primary: 'blue' })
9261
62+ const StyledWrapper = styled.div`
63+ display: flex;
64+ justify-content: space-between;
65+ align-items: center;
66+ `
67+
68+ const StyledLink = styled.a`
69+ color: ${(props) => props.theme.primary} !important;
70+ `
71+
72+ const StyledButton = styled.button`
73+ width: 140px;
74+ height: 36px;
75+ margin-left: 20px;
76+ padding: 4px 12px;
77+ border-radius: 9999px;
78+ box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
79+ background-color: skyblue;
80+ font-weight: bold;
81+ `
82+
83+ const changeTheme = () => {
84+ if (theme.value.primary === 'red') {
85+ theme.value.primary = 'blue'
86+ } else {
87+ theme.value.primary = 'red'
88+ }
89+ }
9390</script>
9491
9592<template>
@@ -114,16 +111,14 @@ and use properties defined in the theme for their styles.
114111::: demo
115112
116113``` vue
117-
118114<script setup lang="ts">
119- import { ThemeProvider } from '@vue3-styled-components/package'
120- import { defineComponent, h, inject } from 'vue'
121-
122- const Link = defineComponent(() => {
123- const theme = inject('$theme')
124- return () => h('a', { style: { color: theme.primary } }, 'This is a link')
125- })
115+ import { ThemeProvider } from '@vue3-styled-components/package'
116+ import { defineComponent, h, inject } from 'vue'
126117
118+ const Link = defineComponent(() => {
119+ const theme = inject('$theme')
120+ return () => h('a', { style: { color: theme.primary } }, 'This is a link')
121+ })
127122</script>
128123
129124<template>
@@ -133,4 +128,4 @@ and use properties defined in the theme for their styles.
133128</template>
134129```
135130
136- :::
131+ :::
0 commit comments