@@ -16,16 +16,15 @@ the `ThemeProvider`'s scope can access this theme object.
16
16
::: demo
17
17
18
18
``` vue
19
-
20
19
<script setup lang="ts">
21
- import { styled, ThemeProvider } from '@vue3-styled-components/package'
20
+ import { styled, ThemeProvider } from '@vue3-styled-components/package'
22
21
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
+ `
27
26
28
- const StyledLink = styled.a`
27
+ const StyledLink = styled.a`
29
28
margin-right: 8px;
30
29
color: ${(props) => props.theme.primary} !important;
31
30
font-weight: bold;
@@ -54,42 +53,40 @@ and see the updates reflected in your styled components.
54
53
::: demo
55
54
56
55
``` vue
57
-
58
56
<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' })
92
61
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
+ }
93
90
</script>
94
91
95
92
<template>
@@ -114,16 +111,14 @@ and use properties defined in the theme for their styles.
114
111
::: demo
115
112
116
113
``` vue
117
-
118
114
<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'
126
117
118
+ const Link = defineComponent(() => {
119
+ const theme = inject('$theme')
120
+ return () => h('a', { style: { color: theme.primary } }, 'This is a link')
121
+ })
127
122
</script>
128
123
129
124
<template>
@@ -133,4 +128,4 @@ and use properties defined in the theme for their styles.
133
128
</template>
134
129
```
135
130
136
- :::
131
+ :::
0 commit comments