From fcad7cfb903ba0e18982243147150ed86d1b0dd6 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Mon, 6 Jul 2020 18:58:52 +0000 Subject: [PATCH] Administration: Adapts the secondary buttons colors to the admin schemes. The admin schemes that don't meet the contrast guidelines are excluded from this change. Props mapk, michaelarestad, mcsf, ocean90. Closes #50537. git-svn-id: https://develop.svn.wordpress.org/trunk@48342 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/colors/_admin.scss | 64 +++++++++++++++++----- src/wp-admin/css/colors/_variables.scss | 2 + src/wp-admin/css/colors/coffee/colors.scss | 1 + src/wp-admin/css/colors/ocean/colors.scss | 1 + 4 files changed, 54 insertions(+), 14 deletions(-) diff --git a/src/wp-admin/css/colors/_admin.scss b/src/wp-admin/css/colors/_admin.scss index 5e3fc55a3e..60189ed03c 100644 --- a/src/wp-admin/css/colors/_admin.scss +++ b/src/wp-admin/css/colors/_admin.scss @@ -41,16 +41,6 @@ span.wp-media-buttons-icon:before { } } -.wp-core-ui .button-link { - color: $link; - - &:hover, - &:active, - &:focus { - color: $link-focus; - } -} - /* Forms */ input[type=checkbox]:checked::before { @@ -132,6 +122,35 @@ textarea:focus { box-shadow: 0 0 0 1px #32373c; } + @if ( $low-contrast-theme != "true" ) { + .button, + .button-secondary { + color: $highlight-color; + border-color: $highlight-color; + } + + .button.hover, + .button:hover, + .button-secondary:hover{ + border-color: darken($highlight-color, 10); + color: darken($highlight-color, 10); + } + + .button.focus, + .button:focus, + .button-secondary:focus { + border-color: lighten($highlight-color, 10); + color: darken($highlight-color, 20);; + box-shadow: 0 0 0 1px lighten($highlight-color, 10); + } + + .button-primary { + &:hover { + color: #fff; + } + } + } + .button-primary { @include button( $button-color ); } @@ -171,11 +190,28 @@ textarea:focus { /* List tables */ +@if $low-contrast-theme == "true" { + .wrap .page-title-action:hover { + color: $menu-text; + background-color: $menu-background; + } +} @else { + .wrap .page-title-action, + .wrap .page-title-action:active { + border: 1px solid $highlight-color; + color: $highlight-color; + } -.wrap .add-new-h2:hover, /* deprecated */ -.wrap .page-title-action:hover { - color: $menu-text; - background-color: $menu-background; + .wrap .page-title-action:hover { + color: darken($highlight-color, 10); + border-color: darken($highlight-color, 10); + } + + .wrap .page-title-action:focus { + border-color: lighten($highlight-color, 10); + color: darken($highlight-color, 20);; + box-shadow: 0 0 0 1px lighten($highlight-color, 10); + } } .view-switch a.current:before { diff --git a/src/wp-admin/css/colors/_variables.scss b/src/wp-admin/css/colors/_variables.scss index c73ba358db..8287a23202 100644 --- a/src/wp-admin/css/colors/_variables.scss +++ b/src/wp-admin/css/colors/_variables.scss @@ -61,3 +61,5 @@ $adminbar-recovery-exit-background: $menu-bubble-background !default; $adminbar-recovery-exit-background-alt: mix(black, $adminbar-recovery-exit-background, 10%) !default; $menu-customizer-text: mix( $base-color, $text-color, 40% ) !default; + +$low-contrast-theme: "false" !default; diff --git a/src/wp-admin/css/colors/coffee/colors.scss b/src/wp-admin/css/colors/coffee/colors.scss index 49bee9be94..64de62e491 100644 --- a/src/wp-admin/css/colors/coffee/colors.scss +++ b/src/wp-admin/css/colors/coffee/colors.scss @@ -1,6 +1,7 @@ $base-color: #59524c; $highlight-color: #c7a589; $notification-color: #9ea476; +$low-contrast-theme: "true"; $form-checked: $base-color; diff --git a/src/wp-admin/css/colors/ocean/colors.scss b/src/wp-admin/css/colors/ocean/colors.scss index d52339c6fe..807d98dccf 100644 --- a/src/wp-admin/css/colors/ocean/colors.scss +++ b/src/wp-admin/css/colors/ocean/colors.scss @@ -2,6 +2,7 @@ $base-color: #738e96; $icon-color: #f2fcff; $highlight-color: #9ebaa0; $notification-color: #aa9d88; +$low-contrast-theme: "true"; $form-checked: $base-color;