props property

  1. @override
Map<String, String> get props

Converts the text style attributes to a CSS style map.

Implementation

@override
Map<String, String> get props => {
  Tokens.current.selectedTextBgColor.name: ?selectionBackgroundColor?.value,
  Tokens.current.selectedTextColor.name: ?selectionTextColor?.value,
  'display': ?display?.value,
  'color': ?color?.value,
  'background-color': ?backgroundColor?.value,
  'font-size': ?fontSize?.cssText,
  'font-weight': ?fontWeight?.value,
  'font-style': ?fontStyle?.name,
  'font-family': ?fontFamily?.value,
  'width': ?width?.cssText,
  'letter-spacing': ?letterSpacing?.cssText,
  'word-spacing': ?wordSpacing?.cssText,
  'line-height': ?lineHeight?.cssText,
  'text-decoration-line': ?decorationLine?.value,
  'text-decoration-color': ?decorationLineColor?.value,
  'text-decoration-style': ?decorationStyle?.name,
  'text-decoration-thickness': ?decorationThickness?.cssText,
  'text-align': ?textAlign?.value,
  'user-select': selectable ? 'text' : 'none',
  'text-wrap-mode': ?(softWrap && !_shouldTruncate ? 'wrap' : null),
  'text-overflow': ?overflow?.value,
  ...?gradient?.props,
  ...?padding?.pProps,
  ...?margin?.mProps,
  ...?extra,
  if (_shouldTruncate) ...Css.nakiTextTruncateStyle,
  if (_shouldClamp) ...{
    Tokens.current.textMaxLines.name: maxLines!.toCleanString,
    ...Css.nakiTextClampStyle,
  },
};