Skip to content

Commit

Permalink
fix(button): flat buttons should have their own text color
Browse files Browse the repository at this point in the history
  • Loading branch information
joneff committed Jul 22, 2021
1 parent 27debfd commit c2bf6a9
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 28 deletions.
24 changes: 15 additions & 9 deletions packages/default/scss/button/_layout.scss
Expand Up @@ -221,23 +221,29 @@
// Flat button and bare
.k-button-flat {
border-color: transparent !important; // sass-lint:disable-line no-important
color: inherit;
background: none !important; // sass-lint:disable-line no-important
box-shadow: none !important; // sass-lint:disable-line no-important
transition: color .2s ease-in-out;

&:hover,
&.k-state-hover,
&:active,
&.k-state-active,
&:focus,
&.k-state-focus {
color: inherit;
// Overlay background
&::before {
display: block;
}

&::before {
// Focus ring
&::after {
box-shadow: inset 0 0 0 2px currentColor;
display: block;
}

&:focus,
&.k-state-focus,
&.k-state-focused {

&::after {
opacity: .12;
}
}
}
.k-button.k-flat,
.k-button.k-bare {
Expand Down
28 changes: 9 additions & 19 deletions packages/default/scss/button/_theme.scss
Expand Up @@ -242,36 +242,26 @@
// Flat button
.k-button-flat {

// Explicitly exclude flat button from button group styling
&,
.k-button-group & {
color: inherit;
background: none;
}

&::after {
display: block;
}

&:hover,
&.k-state-hover,
&:active,
&.k-state-active,
&:focus,
&.k-state-focused,
&.k-state-focus {

&::after {
box-shadow: inset 0 0 0 2px currentColor;
opacity: .12;
}
color: $body-text;
}
}
.k-button-flat.k-primary {

// Explicitly exclude flat button from button group styling
&,
&:hover,
&.k-state-hover,
.k-button-group & {
&:active,
&.k-state-active,
&:focus,
&.k-state-focus {
color: $primary;
background: none;
}
}

Expand Down
11 changes: 11 additions & 0 deletions packages/default/scss/window/_layout.scss
Expand Up @@ -84,6 +84,17 @@
flex-shrink: 0;
align-items: center;
vertical-align: top;

.k-button-flat {
&,
&:hover,
&.k-state-hover,
&:focus,
&.k-state-focus,
&:active {
color: inherit;
}
}
}
.k-window-action {
flex-shrink: 0;
Expand Down

0 comments on commit c2bf6a9

Please sign in to comment.