Fix danger button accessibility

This commit is contained in:
Chocobozzz 2024-09-26 15:02:32 +02:00
parent 499d660723
commit 80e92f76f1
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
12 changed files with 23 additions and 44 deletions

View File

@ -225,9 +225,9 @@
<div class="content-col">
<div class="danger-zone">
<div class="form-group">
<div class="form-group">
<div class="mb-1 fw-bold" i18n>Send a link to reset the password by email to the user</div>
<button class="peertube-button" (click)="resetPassword()" i18n>Ask for new password</button>
<button class="peertube-button danger-button" (click)="resetPassword()" i18n>Ask for new password</button>
</div>
<div class="form-group">
@ -237,7 +237,7 @@
<div *ngIf="user.twoFactorEnabled" class="form-group">
<div class="mb-1 fw-bold" i18n>This user has two factor authentication enabled</div>
<button class="peertube-button" (click)="disableTwoFactorAuth()" i18n>Disable two factor authentication</button>
<button class="peertube-button danger-button" (click)="disableTwoFactorAuth()" i18n>Disable two factor authentication</button>
</div>
</div>

View File

@ -24,11 +24,6 @@ my-select-custom-value {
@include responsive-width($form-base-input-width);
}
.danger-zone button {
@include danger-button;
@include disable-outline;
}
.dashboard {
display: flex;
flex-wrap: wrap;

View File

@ -16,5 +16,5 @@
{{ formErrors.password }}
</div>
<input type="submit" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid">
<input class="peertube-button danger-button mt-2" type="submit" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid">
</form>

View File

@ -5,11 +5,3 @@ input[type=text],
input[type=password] {
@include peertube-input-text(340px);
}
input[type=submit] {
margin-top: 10px;
@include peertube-button;
@include danger-button;
@include disable-outline;
}

View File

@ -1,5 +1,6 @@
<div class="delete-me">
<p i18n>Once you delete your account, there is no going back. You will be asked to confirm this action.</p>
<button (click)="deleteMe()" i18n>Delete your account</button>
<button class="peertube-button danger-button" (click)="deleteMe()" i18n>Delete your account</button>
</div>

View File

@ -1,10 +0,0 @@
@use '_variables' as *;
@use '_mixins' as *;
.delete-me {
button {
@include peertube-button;
@include danger-button;
@include disable-outline;
}
}

View File

@ -4,7 +4,6 @@ import { AuthService, ConfirmService, Notifier, RedirectService, User, UserServi
@Component({
selector: 'my-account-danger-zone',
templateUrl: './my-account-danger-zone.component.html',
styleUrls: [ './my-account-danger-zone.component.scss' ],
standalone: true
})
export class MyAccountDangerZoneComponent {

View File

@ -111,8 +111,9 @@ input[readonly] {
input,
textarea {
outline: none;
color: pvar(--inputForegroundColor);
@include disable-outline;
}
button {

View File

@ -32,6 +32,10 @@
@include tertiary-button;
}
.danger-button {
@include danger-button;
}
.peertube-radio-container {
@include peertube-radio-container;
}

View File

@ -25,7 +25,7 @@
margin-bottom: 10px;
&.pt-title-danger {
color: color.adjust($color: #c54130, $lightness: 10%);
color: pvar(--red);
}
}
}

View File

@ -191,8 +191,8 @@
}
@mixin grey-button {
background-color: pvar(--greyBackgroundColor);
color: pvar(--greyForegroundColor);
background-color: pvar(--greyBackgroundColor);
@include button-focus($grey-button-outline-color);
@ -214,27 +214,24 @@
}
@mixin danger-button {
$color: color.adjust($color: #c54130, $lightness: 10%);
$text: #fff6f5;
background-color: pvar(--red);
color: pvar(--white);
background-color: $color;
color: $text;
@include button-focus(color.scale($color, $alpha: -95%));
@include button-focus(pvar(--red));
&:hover,
&:active,
&:focus,
&[disabled] {
background-color: color.adjust($color: $color, $lightness: 10%);
&:focus:not(:focus-visible) {
opacity: 0.8;
}
&[disabled] {
cursor: default;
opacity: 0.7;
}
my-global-icon {
@include apply-svg-color($text);
@include apply-svg-color(pvar(--white));
}
}

View File

@ -31,8 +31,8 @@ $support-button-heart: #e83e8c;
$bg-color: #fff;
$fg-color: #212529;
$red: #EE0700;
$green: #278904;
$red: #dc3545;
$green: #198754;
$white: #fff;
$expanded-horizontal-margins: 150px;