Skip to content

Commit

Permalink
fix(VBtnToggle): restructure styles, improve v-btn color override (#7515
Browse files Browse the repository at this point in the history
)

* fix(VBtnToggle): restructure styles

allow manual override of btn color/size, improve state visual clarity

fixes #7420

* refactor(VBtnToggle): add sass variables
  • Loading branch information
johnleider committed Jun 16, 2019
1 parent 7e2e2a4 commit 4b4b1a1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
26 changes: 17 additions & 9 deletions packages/vuetify/src/components/VBtnToggle/VBtnToggle.sass
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

// Theme
+theme(v-btn-toggle) using ($material)
background: map-get($material, 'cards')
color: map-deep-get($material, 'text', 'primary')

.v-btn.v-btn
border-color: map-get($material, 'dividers') !important

Expand All @@ -15,19 +18,27 @@

// Block
.v-btn-toggle
border-radius: 2px
border-radius: $btn-toggle-border-radius
display: inline-flex

> .v-btn
opacity: $btn-toggle-btn-opacity

&--active
color: inherit
opacity: 1

&.v-size--default
height: $btn-toggle-btn-height
min-height: 0
min-width: $btn-toggle-btn-width
padding: $btn-toggle-btn-padding

> .v-btn.v-btn
background-color: transparent !important
border-radius: 0
border-style: solid
border-width: thin
box-shadow: none
min-height: 0
min-width: $btn-toggle-btn-width
padding: $btn-toggle-btn-padding
height: $btn-toggle-btn-height

&:first-child
border-top-left-radius: inherit
Expand All @@ -40,9 +51,6 @@
&:after
display: none

&--active
color: inherit

// Modifiers
.v-btn-toggle--rounded
border-radius: $btn-toggle-round-radius
1 change: 1 addition & 0 deletions packages/vuetify/src/components/VBtnToggle/VBtnToggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default mixins(
...ButtonGroup.options.computed.classes.call(this),
'v-btn-toggle': true,
'v-btn-toggle--rounded': this.rounded,
...this.themeClasses,
}
},
},
Expand Down
2 changes: 2 additions & 0 deletions packages/vuetify/src/components/VBtnToggle/_variables.sass
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
$btn-toggle-border-radius: 2px
$btn-toggle-btn-height: 48px !default
$btn-toggle-btn-padding: 0 12px !default
$btn-toggle-btn-width: 48px !default
$btn-toggle-btn-opacity: 0.8
$btn-toggle-round-radius: 24px !default

0 comments on commit 4b4b1a1

Please sign in to comment.