Skip to content

Commit

Permalink
♿ - style: adjust styling of disabled primary button
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvandescheur committed Jul 29, 2024
1 parent f27cde6 commit 86eb0c5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/components/button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,18 @@
white-space: nowrap;
width: var(--mykn-button-width);

&[disabled],
&--disabled {
&:disabled,
&--disabled,
&--muted {
--mykn-button-offset: 0 !important;
pointer-events: none;
opacity: 0.4;
}

&:disabled,
&--disabled {
pointer-events: none;
}

&--align-start {
justify-content: start;
text-align: start;
Expand Down Expand Up @@ -78,10 +83,6 @@
--mykn-button-width: 100%;
}

&--muted {
--mykn-button-color-text: var(--typography-color-muted) !important;
}

&--pad-h {
--mykn-button-padding-h: var(--mykn-button-padding-xs, var(--spacing-h));
}
Expand Down Expand Up @@ -128,6 +129,15 @@
--mykn-button-color-shadow: var(--button-color-shadow-primary);
--mykn-button-color-text: var(--button-color-text-primary);

&#{$self}:disabled,
&#{$self}--disabled,
&#{$self}--muted {
--mykn-button-color-background: var(--button-color-background-secondary);
--mykn-button-color-border: var(--button-color-border-secondary);
--mykn-button-color-shadow: var(--button-color-shadow-secondary);
--mykn-button-color-text: var(--button-color-text-secondary);
}

&:focus,
&:hover {
--mykn-button-color-background: var(
Expand Down
6 changes: 6 additions & 0 deletions src/components/button/button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ export const JustifiedButtons: Story = {
},
};

export const DisabledButtons: Story = {
args: {
disabled: true,
},
};

export const MutedButtons: Story = {
args: {
muted: true,
Expand Down

0 comments on commit 86eb0c5

Please sign in to comment.