@atlaskit/editor-core
Version:
A package contains Atlassian editor core functionality
26 lines (20 loc) • 613 B
text/typescript
export type Alignment = 'left' | 'right' | 'center';
export type Display = 'inline-block' | 'block';
export function textAlign(alignment: Alignment, display: Display): string {
if (display !== 'block') {
return 'left';
}
return alignment;
}
export function float(alignment: Alignment, display: Display): string {
if (display === 'block') {
return 'none';
}
return alignment === 'right' ? 'right' : 'left';
}
export function clear(alignment: Alignment, display: Display): string {
if (display === 'block') {
return 'both';
}
return alignment === 'center' ? 'both' : alignment;
}