Skip to content

Commit

Permalink
fix(file-upload): update error style
Browse files Browse the repository at this point in the history
  • Loading branch information
dpellier committed Jul 29, 2024
1 parent 8d4edf6 commit 4ffbd7d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ $ods-file-upload-spacing: 8px;
}
}

:host(.ods-file-upload--error) {
border-color: var(--ods-color-critical-500);
}

.ods-file-upload {
&__dropzone {
display: inline-flex;
Expand Down Expand Up @@ -53,6 +57,11 @@ $ods-file-upload-spacing: 8px;
}

&__error {
display: flex;
flex-flow: column;
row-gap: 8px;
width: 100%;
text-align: center;
color: var(--ods-color-critical-500);
font-size: font.px-to-rem(12px);
font-weight: 600;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export class OdsFileUpload {
class={{
'ods-file-upload': true,
'ods-file-upload--disabled': this.isDisabled,
'ods-file-upload--error': !!this.error,
}}
onDragEnter={ () => this.onDragEnter() }
onDragLeave={ () => this.onDragLeave() }
Expand Down Expand Up @@ -146,9 +147,13 @@ export class OdsFileUpload {

{
!!this.error &&
<span class="ods-file-upload__dropzone__error">
{ this.error }
</span>
<div class="ods-file-upload__dropzone__error">
<span>
{ this.error }
</span>

<ods-divider></ods-divider>
</div>
}
</div>

Expand Down
1 change: 1 addition & 0 deletions packages/ods/src/components/file-upload/src/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
* import '../../text/src';
*/
import '../../button/src';
import '../../divider/src';
import '../../icon/src';
import '../../progress-bar/src';

0 comments on commit 4ffbd7d

Please sign in to comment.