| 1 |
@use 'sass:map'; |
| 2 |
@use 'sass:list'; |
| 3 |
@use 'sass:color'; |
| 4 |
@use 'theme'; |
| 5 |
|
| 6 |
.badge { |
| 7 |
font-size: 12px; |
| 8 |
font-weight: 700; |
| 9 |
text-transform: uppercase; |
| 10 |
border-radius: 3px; |
| 11 |
text-align: center; |
| 12 |
min-inline-size: 43px; |
| 13 |
min-block-size: 24px; |
| 14 |
display: inline-flex; |
| 15 |
justify-content: center; |
| 16 |
align-items: center; |
| 17 |
padding-block: 0; |
| 18 |
padding-inline: 3px; |
| 19 |
box-sizing: border-box; |
| 20 |
gap: 5px; |
| 21 |
line-height: 1; |
| 22 |
|
| 23 |
.dashicons { |
| 24 |
font-size: 18px; |
| 25 |
inline-size: 18px; |
| 26 |
block-size: 18px; |
| 27 |
} |
| 28 |
} |
| 29 |
|
| 30 |
.small-badge { |
| 31 |
block-size: auto; |
| 32 |
inline-size: auto; |
| 33 |
font-size: smaller; |
| 34 |
padding-block: 0; |
| 35 |
padding-inline: 0.5em; |
| 36 |
} |
| 37 |
|
| 38 |
.wp-core-ui .button.nav-tab-button { |
| 39 |
margin-inline-start: 0.5em; |
| 40 |
float: inline-end; |
| 41 |
color: #a7aaad; |
| 42 |
background: #f6f7f7; |
| 43 |
border-color: #f6f7f7; |
| 44 |
align-self: center; |
| 45 |
display: flex; |
| 46 |
justify-content: center; |
| 47 |
align-items: center; |
| 48 |
gap: 2px; |
| 49 |
} |
| 50 |
|
| 51 |
@each $name, $colors in theme.$badges { |
| 52 |
$text-color: #fff; |
| 53 |
$background-color: list.nth($colors, 1); |
| 54 |
|
| 55 |
@if list.length($colors) > 1 { |
| 56 |
$text-color: list.nth($colors, 2); |
| 57 |
} |
| 58 |
|
| 59 |
.badge.#{$name}-badge, |
| 60 |
.nav-tab-inactive:hover .badge.#{$name}-badge, |
| 61 |
:hover > .inverted-badges .#{$name}-badge { |
| 62 |
color: $text-color; |
| 63 |
background-color: $background-color; |
| 64 |
} |
| 65 |
|
| 66 |
.badge.#{$name}-badge:hover { |
| 67 |
color: $text-color; |
| 68 |
background-color: color.adjust($background-color, $lightness: -5%); |
| 69 |
} |
| 70 |
} |
| 71 |
|
| 72 |
.nav-tab-inactive .badge, |
| 73 |
.inverted-badges .badge { |
| 74 |
color: #fff; |
| 75 |
background-color: #a7aaad; |
| 76 |
} |
| 77 |
|
| 78 |
.nav-tab-inactive { |
| 79 |
$colors: map.get(theme.$badges, 'pro'); |
| 80 |
$text-color: list.nth($colors, 2); |
| 81 |
$background-color: list.nth($colors, 1); |
| 82 |
|
| 83 |
.badge.pro-badge { |
| 84 |
color: $text-color; |
| 85 |
background-color: $background-color; |
| 86 |
} |
| 87 |
|
| 88 |
&:hover { |
| 89 |
&.button, .dashicons-external { |
| 90 |
color: #3c434a; |
| 91 |
} |
| 92 |
|
| 93 |
.badge.pro-badge { |
| 94 |
color: $background-color; |
| 95 |
background-color: $text-color; |
| 96 |
} |
| 97 |
} |
| 98 |
} |
| 99 |
|
| 100 |
.nav-tab-inactive { |
| 101 |
background: transparent; |
| 102 |
} |
| 103 |
|
| 104 |
.nav-tab-button .dashicons-external { |
| 105 |
font-size: 15px; |
| 106 |
color: #666; |
| 107 |
} |
| 108 |
|