33 lines
908 B
TypeScript
33 lines
908 B
TypeScript
import { TypographyRole, TypographySize } from '../typography.types';
|
|
|
|
export function getTypographyRole(role: TypographyRole, size: TypographySize) {
|
|
switch (role) {
|
|
case 'display':
|
|
return 'h1';
|
|
case 'headline':
|
|
switch (size) {
|
|
case 'large' || 'hero' || 'xl':
|
|
return 'h2';
|
|
case 'medium':
|
|
return 'h3';
|
|
case 'small':
|
|
return 'h4';
|
|
}
|
|
break;
|
|
case 'title':
|
|
switch (size) {
|
|
case 'large' || 'hero' || 'xl':
|
|
return 'h4';
|
|
case 'medium':
|
|
return 'h5';
|
|
case 'small':
|
|
return 'h6';
|
|
}
|
|
break;
|
|
case 'body':
|
|
return 'p';
|
|
case 'label':
|
|
return 'label';
|
|
}
|
|
}
|