@@ -20,6 +20,10 @@ import { euiBadgeColors } from '../color_utils';
2020export const euiBetaBadgeStyles = ( euiThemeContext : UseEuiTheme ) => {
2121 const { euiTheme, colorMode } = euiThemeContext ;
2222 const badgeColors = euiBadgeColors ( euiThemeContext ) ;
23+ const badgeSizes = {
24+ m : euiTheme . size . l ,
25+ s : mathWithUnits ( euiTheme . size . base , ( x ) => x * 1.25 ) ,
26+ } ;
2327
2428 return {
2529 euiBetaBadge : css `
@@ -50,27 +54,26 @@ export const euiBetaBadgeStyles = (euiThemeContext: UseEuiTheme) => {
5054 ${ badgeColors . hollow . borderColor } ;
5155 ` ,
5256 warning : css ( badgeColors . warning ) ,
53- // Font sizes (line height + padding-block-start = height of the badge)
57+ // Font sizes
5458 m : css `
5559 font-size : ${ euiFontSizeFromScale ( 'xs' , euiTheme ) } ;
56- line-height : ${ mathWithUnits ( euiTheme . size . l , ( x ) => x * 0.96 ) } ;
60+ line-height : ${ badgeSizes . m } ;
5761 ` ,
5862 s : css `
5963 font-size : 0.7rem ;
60- line-height : ${ mathWithUnits ( '20px' , ( x ) => x * 0.98 ) } ;
64+ line-height : ${ badgeSizes . s } ;
6165 ` ,
6266 // Padding/width sizes
6367 badgeSizes : {
6468 default : {
6569 m : `
66- ${ logicalCSS ( 'height' , euiTheme . size . l ) }
70+ ${ logicalCSS ( 'height' , badgeSizes . m ) }
6771 ${ logicalCSS ( 'padding-horizontal' , euiTheme . size . base ) }
68- padding-block-start: ${ mathWithUnits ( euiTheme . size . l , ( x ) => x * 0.04 ) }
72+ padding-block-start: 1px
6973 ` ,
7074 s : `
71- ${ logicalCSS ( 'height' , '20px' ) }
75+ ${ logicalCSS ( 'height' , badgeSizes . s ) }
7276 ${ logicalCSS ( 'padding-horizontal' , euiTheme . size . m ) }
73- padding-block-start: ${ mathWithUnits ( '20px' , ( x ) => x * 0.02 ) } ;
7477 ` ,
7578 } ,
7679 // When it's just an icon or a single letter, make the badge a circle
0 commit comments