Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(button-action): get rid of obsolete outline important rule #289

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion projects/core/src/button-action/button-action.element.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
--outline-offset: calc(#{$cds-alias-object-interaction-outline-offset} * -1);
pointer-events: none;
display: inline-block;
outline: 0 !important;
}

:host([role='button']) {
Expand Down
15 changes: 13 additions & 2 deletions projects/core/src/forms/control-action/control-action.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* The full license information can be found in LICENSE in the root directory of this project.
*/

import { PropertyValues } from 'lit';
import { assignSlotNames, property } from '@cds/core/internal';
import { css, PropertyValues } from 'lit';
import { assignSlotNames, baseStyles, property } from '@cds/core/internal';
import { CdsButtonAction } from '@cds/core/button-action';

/**
Expand All @@ -27,6 +27,17 @@ import { CdsButtonAction } from '@cds/core/button-action';
export class CdsControlAction extends CdsButtonAction {
@property({ type: String, reflect: true }) action: 'label' | 'prefix' | 'suffix';

static styles = [
baseStyles,
/^((?!chrome|android).)*safari/i.test(navigator.userAgent)
? css`
:host(:focus) {
outline: 0 !important;
}
`
: css``,
];

updated(props: PropertyValues<this>) {
super.updated(props);
assignSlotNames([this, this.action ?? false]);
Expand Down
Loading