23 lines
574 B
TypeScript
23 lines
574 B
TypeScript
export type styleTypeAccessor = 'default' | 'bold' | 'italic' | 'boldItalic';
|
|
|
|
export class TextStyle {
|
|
fontSize: number;
|
|
lineHeight: number;
|
|
constructor(fontSize: number, lineHeight?: number) {
|
|
this.fontSize = fontSize;
|
|
this.lineHeight = lineHeight || fontSize;
|
|
}
|
|
get default() {
|
|
return `${this.fontSize}px Chakra Petch`
|
|
}
|
|
get bold() {
|
|
return `bold ${this.fontSize}px Chakra Petch`
|
|
}
|
|
get italic() {
|
|
return `italic ${this.fontSize}px Chakra Petch`
|
|
}
|
|
get boldItalic() {
|
|
return `italic bold ${this.fontSize}px Chakra Petch`
|
|
}
|
|
}
|