mirror of
https://github.com/apache/superset.git
synced 2024-09-18 19:49:37 -04:00
fix: improve Avatar text size consistency (#11837)
This commit is contained in:
parent
ec01691e22
commit
671ff6c053
@ -17,7 +17,11 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { getCategoricalSchemeRegistry, styled } from '@superset-ui/core';
|
import {
|
||||||
|
getCategoricalSchemeRegistry,
|
||||||
|
styled,
|
||||||
|
SupersetTheme,
|
||||||
|
} from '@superset-ui/core';
|
||||||
import { Tooltip } from 'src/common/components/Tooltip';
|
import { Tooltip } from 'src/common/components/Tooltip';
|
||||||
import { Avatar } from 'src/common/components';
|
import { Avatar } from 'src/common/components';
|
||||||
import { getRandomColor } from './utils';
|
import { getRandomColor } from './utils';
|
||||||
@ -29,20 +33,21 @@ interface FacePileProps {
|
|||||||
|
|
||||||
const colorList = getCategoricalSchemeRegistry().get()?.colors ?? [];
|
const colorList = getCategoricalSchemeRegistry().get()?.colors ?? [];
|
||||||
|
|
||||||
|
const customAvatarStyler = (theme: SupersetTheme) => `
|
||||||
|
width: ${theme.gridUnit * 6}px;
|
||||||
|
height: ${theme.gridUnit * 6}px;
|
||||||
|
line-height: ${theme.gridUnit * 6}px;
|
||||||
|
font-size: ${theme.typography.sizes.m}px;
|
||||||
|
`;
|
||||||
|
|
||||||
const StyledAvatar = styled(Avatar)`
|
const StyledAvatar = styled(Avatar)`
|
||||||
width: ${({ theme }) => theme.gridUnit * 6}px;
|
${({ theme }) => customAvatarStyler(theme)}
|
||||||
height: ${({ theme }) => theme.gridUnit * 6}px;
|
|
||||||
line-height: ${({ theme }) => theme.gridUnit * 6}px;
|
|
||||||
font-size: ${({ theme }) => theme.typography.sizes.xl}px;
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// to apply styling to the maxCount avatar
|
// to apply styling to the maxCount avatar
|
||||||
const StyledGroup = styled(Avatar.Group)`
|
const StyledGroup = styled(Avatar.Group)`
|
||||||
.ant-avatar {
|
.ant-avatar {
|
||||||
width: ${({ theme }) => theme.gridUnit * 6}px;
|
${({ theme }) => customAvatarStyler(theme)}
|
||||||
height: ${({ theme }) => theme.gridUnit * 6}px;
|
|
||||||
line-height: ${({ theme }) => theme.gridUnit * 6}px;
|
|
||||||
font-size: ${({ theme }) => theme.typography.sizes.xl}px;
|
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user