StyledText constructor
Creates styled text rendered as a span.
StyledText('Hello', style: TextStyle(fontWeight: FontWeight.w600));
Implementation
StyledText(String data,
{TextStyle? style, TextAlign? textAlign, int? maxLines})
: super('span',
text: data,
style: _css([
style?.css ?? '',
if (textAlign != null) 'text-align: ${textAlign.name}',
if (maxLines != null) 'display: -webkit-box',
if (maxLines != null) '-webkit-line-clamp: $maxLines',
if (maxLines != null) '-webkit-box-orient: vertical',
if (maxLines != null) 'overflow: hidden',
]));