| @@ -1,7 +1,6 @@ | ||
| 1 | 1 | @use 'sass:map'; |
| 2 | 2 | @use 'sass:list'; |
| 3 | -@use 'sass:color'; | |
| 4 | 3 | @use 'theme'; |
| 5 | 4 | |
| 6 | 5 | .badge { |
| 7 | 6 | font-size: 12px; |
| @@ -6,9 +5,9 @@ | ||
| 6 | 5 | .badge { |
| 7 | 6 | font-size: 12px; |
| 8 | 7 | font-weight: 700; |
| 9 | 8 | text-transform: uppercase; |
| 10 | - border-radius: 3px; | |
| 9 | + border-radius: 5px; | |
| 11 | 10 | text-align: center; |
| 12 | 11 | min-inline-size: 43px; |
| 13 | 12 | min-block-size: 24px; |
| 14 | 13 | display: inline-flex; |
| @@ -34,9 +33,9 @@ | ||
| 34 | 33 | } |
| 35 | 34 | } |
| 36 | 35 | |
| 37 | 36 | .network-shared { |
| 38 | - color: #2271b1; | |
| 37 | + color: var(--cs-color-accent); | |
| 39 | 38 | font-size: 22px; |
| 40 | 39 | inline-size: 100%; |
| 41 | 40 | cursor: help; |
| 42 | 41 | } |
| @@ -51,11 +50,11 @@ | ||
| 51 | 50 | |
| 52 | 51 | .wp-core-ui .button.nav-tab-button { |
| 53 | 52 | margin-inline-start: 0.5em; |
| 54 | 53 | float: inline-end; |
| 55 | - color: #a7aaad; | |
| 56 | - background: #f6f7f7; | |
| 57 | - 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); | |
| 58 | 57 | align-self: center; |
| 59 | 58 | display: flex; |
| 60 | 59 | justify-content: center; |
| 61 | 60 | align-items: center; |
| @@ -66,9 +65,34 @@ | ||
| 66 | 65 | font-size: 15px; |
| 67 | 66 | color: #666; |
| 68 | 67 | } |
| 69 | 68 | |
| 70 | -@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 { | |
| 71 | 95 | $text-color: #fff; |
| 72 | 96 | $background-color: list.nth($colors, 1); |
| 73 | 97 | |
| 74 | 98 | @if list.length($colors) > 1 { |
| @@ -81,18 +105,21 @@ | ||
| 81 | 105 | color: $text-color; |
| 82 | 106 | background-color: $background-color; |
| 83 | 107 | } |
| 84 | 108 | |
| 85 | - .badge.#{$name}-badge:hover { | |
| 109 | + a.badge.#{$name}-badge:hover, | |
| 110 | + button.badge.#{$name}-badge:hover { | |
| 86 | 111 | color: $text-color; |
| 87 | - background-color: color.adjust($background-color, $lightness: -5%); | |
| 112 | + background-color: color-mix(in srgb, $background-color 95%, #000 5%); | |
| 88 | 113 | } |
| 89 | 114 | } |
| 90 | 115 | |
| 116 | +// #646970 (WP gray-50) keeps white badge text at 5.5:1 so locked/unlicensed | |
| 117 | +// states stay WCAG AA without hover; #a7aaad was 2.3:1. | |
| 91 | 118 | .nav-tab-inactive .badge, |
| 92 | 119 | .inverted-badges .badge { |
| 93 | 120 | color: #fff; |
| 94 | - background-color: #a7aaad; | |
| 121 | + background-color: #646970; | |
| 95 | 122 | border-color: #fff !important; |
| 96 | 123 | |
| 97 | 124 | .dashicons { |
| 98 | 125 | color: #fff; |
| @@ -99,9 +126,9 @@ | ||
| 99 | 126 | } |
| 100 | 127 | } |
| 101 | 128 | |
| 102 | 129 | .nav-tab-inactive { |
| 103 | - $colors: map.get(theme.$badges, 'pro'); | |
| 130 | + $colors: map.get($badges, 'pro'); | |
| 104 | 131 | $text-color: list.nth($colors, 2); |
| 105 | 132 | $background-color: list.nth($colors, 1); |
| 106 | 133 | |
| 107 | 134 | background: transparent; |
| @@ -121,4 +148,31 @@ | ||
| 121 | 148 | background-color: $text-color; |
| 122 | 149 | } |
| 123 | 150 | } |
| 124 | 151 | } |
| 152 | + | |
| 153 | +// Override WordPress' .wp-core-ui .button .dashicons { line-height: 1.9 } — | |
| 154 | +// inside a button the inflated line-box would shift the glyph below the | |
| 155 | +// badge's bottom border. Placed at end-of-file so it follows all other | |
| 156 | +// .dashicons rules in source order (no-descending-specificity). | |
| 157 | +.wp-core-ui .button .badge .dashicons { | |
| 158 | + line-height: 1; | |
| 159 | +} | |
| 160 | + | |
| 161 | +// Pro badge consolidated to the navigation pro-chip style: a light accent pill | |
| 162 | +// in every context, overriding the badge colour map and the inverted/nav-tab | |
| 163 | +// variants (whose white !important border must be beaten here). This is a | |
| 164 | +// deliberate final override, so it intentionally follows higher-specificity | |
| 165 | +// context rules above. | |
| 166 | +/* stylelint-disable no-descending-specificity */ | |
| 167 | +.badge.pro-badge, | |
| 168 | +.inverted-badges .badge.pro-badge, | |
| 169 | +.nav-tab-inactive .badge.pro-badge { | |
| 170 | + color: var(--cs-color-accent); | |
| 171 | + background-color: var(--cs-color-surface-info); | |
| 172 | + border: 1px solid rgb(34 113 177 / 10%) !important; | |
| 173 | + border-radius: 999px; | |
| 174 | + padding-block: 3px; | |
| 175 | + padding-inline: 10px; | |
| 176 | + line-height: normal; | |
| 177 | +} | |
| 178 | +/* stylelint-enable no-descending-specificity */ | |