Skip to content

Commit

Permalink
fix(VTabs): tabs default color
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Jul 15, 2019
1 parent d526302 commit 79016c3
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/vuetify/src/components/VTabs/VTabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default baseMixins.extend<options>().extend({
},
computedColor (): string {
if (this.color) return this.color
else if (this.isDark && !this.rootIsDark) return 'white'
else if (this.isDark && !this.appIsDark) return 'white'
else return 'primary'
},
},
Expand Down
11 changes: 1 addition & 10 deletions packages/vuetify/src/components/VTabs/VTabsItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,7 @@ export default VWindow.extend({
}
},
isDark (): boolean {
if (this.dark === true) {
// explicitly dark
return true
} else if (this.light === true) {
// explicitly light
return false
} else {
// inherit from root
return this.rootIsDark
}
return this.rootIsDark
},
},

Expand Down
2 changes: 1 addition & 1 deletion packages/vuetify/src/mixins/selectable/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default mixins(
computedColor (): string | undefined {
if (!this.isActive) return undefined
if (this.color) return this.color
if (this.isDark && !this.rootIsDark) return 'white'
if (this.isDark && !this.appIsDark) return 'white'
return 'accent'
},
isMultiple (): boolean {
Expand Down
5 changes: 4 additions & 1 deletion packages/vuetify/src/mixins/themeable/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ const Themeable = Vue.extend<Themeable>().extend({
},

computed: {
appIsDark (): boolean {
return this.$vuetify.theme.dark || false
},
isDark (): boolean {
if (this.dark === true) {
// explicitly dark
Expand Down Expand Up @@ -83,7 +86,7 @@ const Themeable = Vue.extend<Themeable>().extend({
return false
} else {
// inherit from v-app
return this.$vuetify.theme.dark || false
return this.appIsDark
}
},
rootThemeClasses (): Dictionary<boolean> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ describe('validatable.ts', () => {
let mountFunction: (options?: MountOptions<Instance>) => Wrapper<Instance>
beforeEach(() => {
mountFunction = (options?: MountOptions<Instance>) => {
return mount(Mock, options)
return mount(Mock, {
mocks: {
$vuetify: {
theme: { dark: false },
},
},
...options,
})
}
})

Expand Down
2 changes: 1 addition & 1 deletion packages/vuetify/src/mixins/validatable/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default mixins(
// have a white color. If the entire app
// is setup to be dark, then they will
// like want to use their primary color
if (this.isDark && !this.rootIsDark) return 'white'
if (this.isDark && !this.appIsDark) return 'white'
else return 'primary'
},
hasError (): boolean {
Expand Down

0 comments on commit 79016c3

Please sign in to comment.