DONE: Full typography
CHANGES: Everywhere change <span> labels to <Typography> FIXED: Imports in SASS files
This commit is contained in:
32
src/primitive-components/typography/get-typography-role.ts
Normal file
32
src/primitive-components/typography/get-typography-role.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
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';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user