Skip to content

Commit faeb8df

Browse files
committed
fix(VCarousel): children inherit theme from carousel's parent
fixes #8392
1 parent bb252c1 commit faeb8df

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

packages/vuetify/src/components/VCarousel/VCarousel.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import VWindow from '../VWindow/VWindow'
88
import VBtn from '../VBtn'
99
import VIcon from '../VIcon'
1010
import VProgressLinear from '../VProgressLinear'
11+
import { VThemeProvider } from '../VThemeProvider'
1112

1213
// Mixins
1314
// TODO: Move this into core components v2.0
@@ -113,6 +114,16 @@ export default VWindow.extend({
113114
},
114115

115116
methods: {
117+
genDefaultSlot () {
118+
return this.$slots.default?.map(item => {
119+
return this.$createElement(VThemeProvider, {
120+
props: {
121+
light: !this.theme.isDark,
122+
dark: this.theme.isDark,
123+
},
124+
}, [item])
125+
})
126+
},
116127
genControlIcons () {
117128
if (this.isVertical) return null
118129

packages/vuetify/src/components/VWindow/VWindow.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,11 @@ export default BaseItemGroup.extend({
117117
},
118118

119119
methods: {
120+
genDefaultSlot () {
121+
return this.$slots.default
122+
},
120123
genContainer (): VNode {
121-
const children = [this.$slots.default]
124+
const children = [this.genDefaultSlot()]
122125

123126
if (this.showArrows) {
124127
children.push(this.genControlIcons())

0 commit comments

Comments
 (0)