本文整理汇总了TypeScript中@mixins.centerImage函数的典型用法代码示例。如果您正苦于以下问题:TypeScript centerImage函数的具体用法?TypeScript centerImage怎么用?TypeScript centerImage使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了centerImage函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: url
${({
size,
disabled,
icon,
opacity,
}: {
size: number;
disabled: boolean;
icon: string;
opacity: number;
}) => css`
${centerImage(`${size}px`, `${size}px`)};
opacity: ${disabled ? 0.25 : opacity};
background-image: url(${icon});
`};
示例2: url
${body2()};
`;
export const InfoContainer = styled.div`
display: flex;
align-items: center;
justify-content: space-between;
margin-right: 16px;
`;
export const WeatherIcon = styled.div`
width: 24px;
height: 24px;
display: flex;
margin-right: 16px;
${centerImage('24px', 'auto')};
background-image: url(${({ src }: { src: string }) => src});
`;
export const TempContainer = styled.div`
width: 64px;
text-align: right;
white-space: nowrap;
`;
export const Temp = styled.span`
color: rgba(
0,
0,
0,
示例3: rgba
cursor: pointer;
border-radius: 4px;
transition: 0.2s background-color;
&:first-child {
margin-left: 0px;
}
&:hover {
background-color: rgba(0, 0, 0, 0.06);
}
`;
export const Title = styled.div`
padding-left: 2px;
padding-right: 2px;
color: rgba(0, 0, 0, ${transparency.light.secondaryText});
${subtitle2()};
`;
export const HomeIcon = styled.div`
width: 20px;
height: 20px;
transition: 0.2s opacity;
background-image: url(${icons.home});
opacity: ${transparency.light.inactiveIcon};
${centerImage('100%', 'auto')};
`;
示例4: rgba
min-height: 72px;
height: auto;
background-color: #fff;
border-radius: 4px;
overflow: hidden;
margin-bottom: 24px;
box-shadow: 0 1px 1px 0 rgba(60, 64, 67, 0.08),
0 1px 3px 1px rgba(60, 64, 67, 0.16);
`;
export const Thumbnail = styled.div`
width: 100%;
height: 194px;
background-image: url(${({ src }: { src: string }) => src});
${centerImage('100%', '194px')};
`;
export const Header = styled.div`
display: flex;
flex-flow: column;
padding: 16px;
`;
export const Logo = styled.div`
width: 40px;
height: 40px;
margin-left: 16px;
align-self: center;
justify-self: left;
border-radius: 100%;
示例5:
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 13px;
opacity: ${transparency.light.primaryText};
`;
export const SecondaryText = styled.div`
${body2()};
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding-right: 16px;
font-size: 13px;
opacity: ${transparency.light.secondaryText};
`;
export const Icon = styled.div`
position: absolute;
left: 16px;
width: 16px;
height: 16px;
${centerImage('16px', '16px')};
`;
export const Dash = styled.div`
margin-left: 4px;
margin-right: 4px;
opacity: ${transparency.light.secondaryText};
`;
示例6: url
background-color: ${selected
? 'rgba(0, 0, 0, 0.1)'
: 'rgba(0, 0, 0, 0.04)'};
}
`};
&:last-child {
border-bottom: none;
}
`;
export const Icon = styled.div`
height: 16px;
min-width: 16px;
margin-left: 24px;
${centerImage('16px', 'auto')};
${({ icon }: { icon: string }) => css`
background-image: url(${icon});
`};
`;
export const PrimaryText = styled.div`
opacity: ${transparency.light.primaryText};
${body2()};
`;
export const SecondaryText = styled.div`
opacity: ${transparency.light.secondaryText};