Skip to content

Commit

Permalink
Disabled state simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobozzz committed Sep 19, 2024
1 parent 1111d66 commit ca1bc34
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
Cancel
</button>

<button *ngIf="isAddButtonDisplayed()" class="peertube-button orange-button" [ngClass]="{ disabled: !form.valid || addingComment }">
<button *ngIf="isAddButtonDisplayed()" class="peertube-button orange-button" [disabled]="!form.valid || addingComment">
{{ addingCommentButtonValue }}
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ <h5 *ngIf="playlist" i18n class="text-center mb-4">Share the video</h5>
i18n-labelText labelText="Auto select subtitle"
></my-peertube-checkbox>

<div class="peertube-select-container" [ngClass]="{ disabled: !customizations.subtitleCheckbox }">
<div class="peertube-select-container">
<select [(ngModel)]="customizations.subtitle" [disabled]="!customizations.subtitleCheckbox" class="form-control">
<option *ngFor="let caption of videoCaptions" [value]="caption.language.id">{{ caption.language.label }}</option>
</select>
Expand Down
29 changes: 7 additions & 22 deletions client/src/sass/include/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@
background-color: pvar(--mainHoverColor);
}

&[disabled],
&.disabled {
&[disabled] {
cursor: default;
color: #fff;
background-color: pvar(--inputBorderColor);
Expand Down Expand Up @@ -165,8 +164,7 @@
background-color: pvar(--mainColorLightest);
}

&[disabled],
&.disabled {
&[disabled] {
cursor: default;
color: pvar(--mainColor);
background-color: pvar(--inputBorderColor);
Expand All @@ -183,8 +181,7 @@

@include button-focus($grey-button-outline-color);

&[disabled],
.disabled {
&[disabled] {
cursor: default;
}

Expand All @@ -202,14 +199,12 @@
&:hover,
&:active,
&:focus,
&[disabled],
&.disabled {
&[disabled] {
color: pvar(--greyForegroundColor);
background-color: pvar(--greySecondaryBackgroundColor);
}

&[disabled],
&.disabled {
&[disabled] {
cursor: default;
}

Expand All @@ -230,13 +225,11 @@
&:hover,
&:active,
&:focus,
&[disabled],
&.disabled {
&[disabled] {
background-color: color.adjust($color: $color, $lightness: 10%);
}

&[disabled],
&.disabled {
&[disabled] {
cursor: default;
}

Expand Down Expand Up @@ -369,14 +362,6 @@
position: relative;
height: min-content;

&.disabled {
background-color: #E5E5E5;

select {
cursor: default;
}
}

select[disabled] {
background-color: #f9f9f9;
}
Expand Down

0 comments on commit ca1bc34

Please sign in to comment.