Skip to content

Commit

Permalink
fix: disabled file selector
Browse files Browse the repository at this point in the history
  • Loading branch information
DanWebb committed Feb 27, 2024
1 parent fcef04b commit d931437
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
18 changes: 10 additions & 8 deletions components/control/Button/Button.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ diamond-button {
user-select: none;

@media (hover: hover) {
&:hover {
&:not([disabled]):hover {
--_background: var(--_background-hover);
--_border-color: var(--_border-color-hover);
--_color: var(--_color-hover);
Expand All @@ -63,20 +63,22 @@ diamond-button {
outline-offset: var(--diamond-button-outline-offset);
}

&[disabled] {
--_background: var(--_background-disabled);
--_color: var(--_color-disabled);
--_border-color: var(--_border-color-disabled);
cursor: not-allowed;
}

svg {
block-size: var(--diamond-icon-size);
flex-shrink: 0;
inline-size: var(--diamond-icon-size);
}
}

button[disabled],
input[disabled],
input[type='file'][disabled]::file-selector-button {
--_background: var(--_background-disabled);
--_color: var(--_color-disabled);
--_border-color: var(--_border-color-disabled);
cursor: not-allowed;
}

&[size='sm'] {
--_size: 0.875rem;
}
Expand Down
5 changes: 5 additions & 0 deletions components/control/Button/Button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ export const HtmlButtonTypes: StoryObj = {
<input type="file" />
</diamond-button>
</diamond-grid-item>
<diamond-grid-item>
<diamond-button>
<input type="file" disabled />
</diamond-button>
</diamond-grid-item>
</diamond-grid>
`,
};
Expand Down

0 comments on commit d931437

Please sign in to comment.