Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | 19x 90x 90x 90x | import { css, cssClass } from '../styled';
import { palette, fontSize, space, theme } from '../utils';
export const Rating = styleProps => cssClass`
align-items: center;
display: flex;
& {
${theme(styleProps.themeKey, `css.root`)(styleProps)};
}
`;
export const RatingItem = styleProps => cssClass`
color: ${
styleProps.isActive ? palette(styleProps.color, styleProps.color)(styleProps) : palette('white900')(styleProps)
};
display: inline-flex;
transition: color 0.1s, transform 0.2s;
${!styleProps.disabled &&
css`
&:hover {
transform: scale(1.2);
}
&:hover:active {
transform: scale(1.1);
}
`}
${styleProps.disabled &&
css`
cursor: not-allowed;
opacity: 0.5;
`}
&:not(:first-of-type) {
margin-left: ${space(1)(styleProps)}rem;
}
${getSizeAttributes(styleProps)};
& {
${theme(styleProps.themeKey, `css.root`)(styleProps)};
}
`;
function getSizeAttributes(styleProps) {
const sizeAttributes = {
small: css`
font-size: ${fontSize('300')(styleProps)}rem;
& {
${theme(styleProps.themeKey, `css.sizes.small`)(styleProps)};
}
`,
default: css`
font-size: ${fontSize('400')(styleProps)}rem;
& {
${theme(styleProps.themeKey, `css.sizes.default`)(styleProps)};
}
`,
medium: css`
font-size: ${fontSize('500')(styleProps)}rem;
& {
${theme(styleProps.themeKey, `css.sizes.medium`)(styleProps)};
}
`,
large: css`
font-size: ${fontSize('600')(styleProps)}rem;
& {
${theme(styleProps.themeKey, `css.sizes.large`)(styleProps)};
}
`
};
return sizeAttributes[styleProps.size || 'default'];
}
|