You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/docs/guide/advances/theming.md
+52-2Lines changed: 52 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ outline: deep
8
8
to all its descendant Vue components via props. All styled components within the render tree will have access to the
9
9
provided theme.
10
10
11
-
## Basic Theming
11
+
## Basic
12
12
13
13
The `ThemeProvider` wraps its children components and passes a theme object to them. All styled components within
14
14
the `ThemeProvider`'s scope can access this theme object.
@@ -45,7 +45,7 @@ const StyledLink = styled.a`
45
45
46
46
In this example, the `StyledLink` component uses the primary color from the provided theme.
47
47
48
-
## Reactive Theming
48
+
## Reactive
49
49
50
50
You can also make your theme reactive by using Vue's reactivity system. This allows you to dynamically change the theme
51
51
and see the updates reflected in your styled components.
@@ -98,7 +98,57 @@ const changeTheme = () => {
98
98
</ThemeProvider>
99
99
</template>
100
100
```
101
+
:::
102
+
103
+
## Functional Theme
104
+
105
+
You may need to use functional themes, instead of object themes. For example, you may need to reverse colors, or change the color based on other conditions.
106
+
107
+
:::demo
108
+
```vue
109
+
<script setup lang="ts">
110
+
import styled, { ThemeProvider } from '@vue-styled-components/core'
0 commit comments