|
@@ -65,35 +65,28 @@ const getButtonStyles = (theme: GrafanaTheme, size: ButtonSize, variant: ButtonV
|
|
|
background,
|
|
background,
|
|
|
fontSize,
|
|
fontSize,
|
|
|
iconDistance,
|
|
iconDistance,
|
|
|
|
|
+ height,
|
|
|
fontWeight = theme.typography.weight.semibold;
|
|
fontWeight = theme.typography.weight.semibold;
|
|
|
|
|
|
|
|
switch (size) {
|
|
switch (size) {
|
|
|
- case ButtonSize.ExtraSmall:
|
|
|
|
|
- padding = `${theme.spacing.xs} ${theme.spacing.sm}`;
|
|
|
|
|
- fontSize = theme.typography.size.xs;
|
|
|
|
|
- iconDistance = theme.spacing.xs;
|
|
|
|
|
- break;
|
|
|
|
|
case ButtonSize.Small:
|
|
case ButtonSize.Small:
|
|
|
padding = `${theme.spacing.xs} ${theme.spacing.sm}`;
|
|
padding = `${theme.spacing.xs} ${theme.spacing.sm}`;
|
|
|
fontSize = theme.typography.size.sm;
|
|
fontSize = theme.typography.size.sm;
|
|
|
iconDistance = theme.spacing.xs;
|
|
iconDistance = theme.spacing.xs;
|
|
|
|
|
+ height = theme.height.sm;
|
|
|
break;
|
|
break;
|
|
|
case ButtonSize.Large:
|
|
case ButtonSize.Large:
|
|
|
padding = `${theme.spacing.md} ${theme.spacing.lg}`;
|
|
padding = `${theme.spacing.md} ${theme.spacing.lg}`;
|
|
|
fontSize = theme.typography.size.lg;
|
|
fontSize = theme.typography.size.lg;
|
|
|
fontWeight = theme.typography.weight.regular;
|
|
fontWeight = theme.typography.weight.regular;
|
|
|
iconDistance = theme.spacing.sm;
|
|
iconDistance = theme.spacing.sm;
|
|
|
- break;
|
|
|
|
|
- case ButtonSize.ExtraLarge:
|
|
|
|
|
- padding = `${theme.spacing.md} ${theme.spacing.lg}`;
|
|
|
|
|
- fontSize = theme.typography.size.lg;
|
|
|
|
|
- fontWeight = theme.typography.weight.regular;
|
|
|
|
|
- iconDistance = theme.spacing.sm;
|
|
|
|
|
|
|
+ height = theme.height.lg;
|
|
|
break;
|
|
break;
|
|
|
default:
|
|
default:
|
|
|
padding = `${theme.spacing.sm} ${theme.spacing.md}`;
|
|
padding = `${theme.spacing.sm} ${theme.spacing.md}`;
|
|
|
iconDistance = theme.spacing.sm;
|
|
iconDistance = theme.spacing.sm;
|
|
|
fontSize = theme.typography.size.base;
|
|
fontSize = theme.typography.size.base;
|
|
|
|
|
+ height = theme.height.md;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
switch (variant) {
|
|
switch (variant) {
|
|
@@ -133,7 +126,8 @@ const getButtonStyles = (theme: GrafanaTheme, size: ButtonSize, variant: ButtonV
|
|
|
return {
|
|
return {
|
|
|
button: css`
|
|
button: css`
|
|
|
label: button;
|
|
label: button;
|
|
|
- display: inline-block;
|
|
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
font-weight: ${fontWeight};
|
|
font-weight: ${fontWeight};
|
|
|
font-size: ${fontSize};
|
|
font-size: ${fontSize};
|
|
|
font-family: ${theme.typography.fontFamily.sansSerif};
|
|
font-family: ${theme.typography.fontFamily.sansSerif};
|
|
@@ -143,6 +137,7 @@ const getButtonStyles = (theme: GrafanaTheme, size: ButtonSize, variant: ButtonV
|
|
|
vertical-align: middle;
|
|
vertical-align: middle;
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
border: none;
|
|
border: none;
|
|
|
|
|
+ height: ${height};
|
|
|
border-radius: ${borderRadius};
|
|
border-radius: ${borderRadius};
|
|
|
${background};
|
|
${background};
|
|
|
|
|
|
|
@@ -161,6 +156,7 @@ const getButtonStyles = (theme: GrafanaTheme, size: ButtonSize, variant: ButtonV
|
|
|
icon: css`
|
|
icon: css`
|
|
|
label: button-icon;
|
|
label: button-icon;
|
|
|
margin-right: ${iconDistance};
|
|
margin-right: ${iconDistance};
|
|
|
|
|
+ filter: brightness(100);
|
|
|
`,
|
|
`,
|
|
|
};
|
|
};
|
|
|
};
|
|
};
|