| @@ -1,29 +1,13 @@ | ||
| 1 | 1 | @use 'sass:map'; |
| 2 | 2 | @use 'sass:list'; |
| 3 | -@use 'sass:color'; | |
| 4 | 3 | @use 'theme'; |
| 5 | 4 | |
| 6 | -// Badges are wrapped in links that filter by type. The white ring separates the | |
| 7 | -// focus indicator from the badge, matching the activation switch. `:focus` is | |
| 8 | -// included because a click otherwise leaves the WordPress ring, which hugs the | |
| 9 | -// badge. | |
| 10 | -@mixin badge-link { | |
| 11 | - display: inline-flex; | |
| 12 | - border-radius: 3px; | |
| 13 | - | |
| 14 | - &:focus, | |
| 15 | - &:focus-visible { | |
| 16 | - outline: none; | |
| 17 | - box-shadow: 0 0 0 2px #fff, 0 0 0 4px theme.$accent; | |
| 18 | - } | |
| 19 | -} | |
| 20 | - | |
| 21 | 5 | .badge { |
| 22 | 6 | font-size: 12px; |
| 23 | 7 | font-weight: 700; |
| 24 | 8 | text-transform: uppercase; |
| 25 | - border-radius: 3px; | |
| 9 | + border-radius: 5px; | |
| 26 | 10 | text-align: center; |
| 27 | 11 | min-inline-size: 43px; |
| 28 | 12 | min-block-size: 24px; |
| 29 | 13 | display: inline-flex; |
| @@ -49,9 +33,9 @@ | ||
| 49 | 33 | } |
| 50 | 34 | } |
| 51 | 35 | |
| 52 | 36 | .network-shared { |
| 53 | - color: theme.$accent; | |
| 37 | + color: var(--cs-color-accent); | |
| 54 | 38 | font-size: 22px; |
| 55 | 39 | inline-size: 100%; |
| 56 | 40 | cursor: help; |
| 57 | 41 | } |
| @@ -66,11 +50,11 @@ | ||
| 66 | 50 | |
| 67 | 51 | .wp-core-ui .button.nav-tab-button { |
| 68 | 52 | margin-inline-start: 0.5em; |
| 69 | 53 | float: inline-end; |
| 70 | - color: #a7aaad; | |
| 71 | - background: #f6f7f7; | |
| 72 | - border-color: #f6f7f7; | |
| 54 | + color: var(--cs-color-text-disabled); | |
| 55 | + background: var(--cs-color-surface-subtle); | |
| 56 | + border-color: var(--cs-color-surface-subtle); | |
| 73 | 57 | align-self: center; |
| 74 | 58 | display: flex; |
| 75 | 59 | justify-content: center; |
| 76 | 60 | align-items: center; |
| @@ -81,9 +65,34 @@ | ||
| 81 | 65 | font-size: 15px; |
| 82 | 66 | color: #666; |
| 83 | 67 | } |
| 84 | 68 | |
| 85 | -@each $name, $colors in theme.$badges { | |
| 69 | +/* format: background-color [color] */ | |
| 70 | +$badges: ( | |
| 71 | + // php/html/cond darkened for WCAG AA — at least 4.5:1 against white 12px | |
| 72 | + // bold text; php reuses the accent token, html/cond keep hue at reduced lightness. | |
| 73 | + php: #2271b1, | |
| 74 | + html: #cd4510, | |
| 75 | + css: #9b59b6, | |
| 76 | + js: #f7d67a #1c1f20, | |
| 77 | + cond: #22826f, | |
| 78 | + core: #0ca0a9, | |
| 79 | + pro: #f7e8e3 #df9279, | |
| 80 | + revisions: #50575e, | |
| 81 | + cloud: #009fb4, | |
| 82 | + bundles: #50575e, | |
| 83 | + cloud_search: #d27c00, | |
| 84 | + private: #f7e6be #a27813, | |
| 85 | + public: #dbebf7 #2271b1, | |
| 86 | + success: #d3e8d1 #447340, | |
| 87 | + failure: #fad7c1 #a24b16, | |
| 88 | + info: #d2e6f4 #2b71a3, | |
| 89 | + neutral: #f6f7f7 #646970, | |
| 90 | + neutralDark: #e2e5e5 #6c7e7e, | |
| 91 | + special: #dfc5ef #6e249c | |
| 92 | +); | |
| 93 | + | |
| 94 | +@each $name, $colors in $badges { | |
| 86 | 95 | $text-color: #fff; |
| 87 | 96 | $background-color: list.nth($colors, 1); |
| 88 | 97 | |
| 89 | 98 | @if list.length($colors) > 1 { |
| @@ -99,9 +108,9 @@ | ||
| 99 | 108 | |
| 100 | 109 | a.badge.#{$name}-badge:hover, |
| 101 | 110 | button.badge.#{$name}-badge:hover { |
| 102 | 111 | color: $text-color; |
| 103 | - background-color: color.adjust($background-color, $lightness: -5%); | |
| 112 | + background-color: color-mix(in srgb, $background-color 95%, #000 5%); | |
| 104 | 113 | } |
| 105 | 114 | } |
| 106 | 115 | |
| 107 | 116 | // #646970 (WP gray-50) keeps white badge text at 5.5:1 so locked/unlicensed |
| @@ -117,9 +126,9 @@ | ||
| 117 | 126 | } |
| 118 | 127 | } |
| 119 | 128 | |
| 120 | 129 | .nav-tab-inactive { |
| 121 | - $colors: map.get(theme.$badges, 'pro'); | |
| 130 | + $colors: map.get($badges, 'pro'); | |
| 122 | 131 | $text-color: list.nth($colors, 2); |
| 123 | 132 | $background-color: list.nth($colors, 1); |
| 124 | 133 | |
| 125 | 134 | background: transparent; |
| @@ -157,10 +166,10 @@ | ||
| 157 | 166 | /* stylelint-disable no-descending-specificity */ |
| 158 | 167 | .badge.pro-badge, |
| 159 | 168 | .inverted-badges .badge.pro-badge, |
| 160 | 169 | .nav-tab-inactive .badge.pro-badge { |
| 161 | - color: theme.$accent; | |
| 162 | - background-color: #eff5f9; | |
| 170 | + color: var(--cs-color-accent); | |
| 171 | + background-color: var(--cs-color-surface-info); | |
| 163 | 172 | border: 1px solid rgb(34 113 177 / 10%) !important; |
| 164 | 173 | border-radius: 999px; |
| 165 | 174 | padding-block: 3px; |
| 166 | 175 | padding-inline: 10px; |