Skip to content

bug: --background-hover being overridden on ion-button fill="clear" and color #23441

@reed-lawrence

Description

@reed-lawrence

Ionic version:
"@ionic/core": "^5.6.9"
"@ionic/angular": "^5.6.9"
"@angular/core": "~10.0.0"

Current behavior:
<ion-button fill="clear" style="--background-hover: transparent; --background-hover-opacity: 0;">

Hovered ion-buttons still show a background.

Screen Shot 2021-06-10 at 8 55 21 AM

Chrome inspector shows:
Screen Shot 2021-06-10 at 8 43 45 AM

Which digging through the node_modules:
node_modules/@ionic/core/dist/collection/components/button/button.md.css

Line 417:

@media (any-hover: hover) {
  :host(.button-solid.ion-color:hover) .button-native::after {
    background: var(--ion-color-contrast);
    opacity: 0.08;
  }

  :host(.button-clear.ion-color:hover) .button-native::after,
:host(.button-outline.ion-color:hover) .button-native::after {
    background: var(--ion-color-base);
    opacity: 0.04;
  }
}

Which looks to be a compiled output from here: https://github.com/ionic-team/ionic-framework/blob/master/core/src/components/button/button.md.scss

Expected behavior:
On a desktop application (untested on mobile):

The above styles would expect the button to not have a background when hovered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions