Fix danger button accessibility

pull/6648/head
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="content-col">
<div class="danger-zone"> <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> <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>
<div class="form-group"> <div class="form-group">
@ -237,7 +237,7 @@
<div *ngIf="user.twoFactorEnabled" class="form-group"> <div *ngIf="user.twoFactorEnabled" class="form-group">
<div class="mb-1 fw-bold" i18n>This user has two factor authentication enabled</div> <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>
</div> </div>

View File

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

View File

@ -16,5 +16,5 @@
{{ formErrors.password }} {{ formErrors.password }}
</div> </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> </form>

View File

@ -5,11 +5,3 @@ input[type=text],
input[type=password] { input[type=password] {
@include peertube-input-text(340px); @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"> <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> <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> </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({ @Component({
selector: 'my-account-danger-zone', selector: 'my-account-danger-zone',
templateUrl: './my-account-danger-zone.component.html', templateUrl: './my-account-danger-zone.component.html',
styleUrls: [ './my-account-danger-zone.component.scss' ],
standalone: true standalone: true
}) })
export class MyAccountDangerZoneComponent { export class MyAccountDangerZoneComponent {

View File

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

View File

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

View File

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

View File

@ -191,8 +191,8 @@
} }
@mixin grey-button { @mixin grey-button {
background-color: pvar(--greyBackgroundColor);
color: pvar(--greyForegroundColor); color: pvar(--greyForegroundColor);
background-color: pvar(--greyBackgroundColor);
@include button-focus($grey-button-outline-color); @include button-focus($grey-button-outline-color);
@ -214,27 +214,24 @@
} }
@mixin danger-button { @mixin danger-button {
$color: color.adjust($color: #c54130, $lightness: 10%); background-color: pvar(--red);
$text: #fff6f5; color: pvar(--white);
background-color: $color; @include button-focus(pvar(--red));
color: $text;
@include button-focus(color.scale($color, $alpha: -95%));
&:hover, &:hover,
&:active, &:active,
&:focus, &:focus:not(:focus-visible) {
&[disabled] { opacity: 0.8;
background-color: color.adjust($color: $color, $lightness: 10%);
} }
&[disabled] { &[disabled] {
cursor: default; cursor: default;
opacity: 0.7;
} }
my-global-icon { 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; $bg-color: #fff;
$fg-color: #212529; $fg-color: #212529;
$red: #EE0700; $red: #dc3545;
$green: #278904; $green: #198754;
$white: #fff; $white: #fff;
$expanded-horizontal-margins: 150px; $expanded-horizontal-margins: 150px;