@@ -48,6 +48,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
4848 colorDirectMentionBackground: const HSLColor .fromAHSL (0.2 , 240 , 0.7 , 0.7 ).toColor (),
4949 colorGlobalTimeBackground: const HSLColor .fromAHSL (1 , 0 , 0 , 0.93 ).toColor (),
5050 colorGlobalTimeBorder: const HSLColor .fromAHSL (1 , 0 , 0 , 0.8 ).toColor (),
51+ colorHighlightBackground: const Color (0xfffcef9f ),
5152 colorLink: const HSLColor .fromAHSL (1 , 200 , 1 , 0.4 ).toColor (),
5253 colorMathBlockBorder: const HSLColor .fromAHSL (0.15 , 240 , 0.8 , 0.5 ).toColor (),
5354 colorMessageMediaContainerBackground: const Color .fromRGBO (0 , 0 , 0 , 0.03 ),
@@ -82,6 +83,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
8283 colorDirectMentionBackground: const HSLColor .fromAHSL (0.25 , 240 , 0.52 , 0.6 ).toColor (),
8384 colorGlobalTimeBackground: const HSLColor .fromAHSL (0.2 , 0 , 0 , 0 ).toColor (),
8485 colorGlobalTimeBorder: const HSLColor .fromAHSL (0.4 , 0 , 0 , 0 ).toColor (),
86+ colorHighlightBackground: const Color (0xffffe757 ).withValues (alpha: 0.35 ),
8587 colorLink: const HSLColor .fromAHSL (1 , 200 , 1 , 0.4 ).toColor (), // the same as light in Web
8688 colorMathBlockBorder: const HSLColor .fromAHSL (1 , 240 , 0.4 , 0.4 ).toColor (),
8789 colorMessageMediaContainerBackground: const HSLColor .fromAHSL (0.03 , 0 , 0 , 1 ).toColor (),
@@ -115,6 +117,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
115117 required this .colorDirectMentionBackground,
116118 required this .colorGlobalTimeBackground,
117119 required this .colorGlobalTimeBorder,
120+ required this .colorHighlightBackground,
118121 required this .colorLink,
119122 required this .colorMathBlockBorder,
120123 required this .colorMessageMediaContainerBackground,
@@ -148,6 +151,10 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
148151 final Color colorDirectMentionBackground;
149152 final Color colorGlobalTimeBackground;
150153 final Color colorGlobalTimeBorder;
154+
155+ // From Figma: https://www.figma.com/design/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=10904-102278&m=dev
156+ final Color colorHighlightBackground;
157+
151158 final Color colorLink;
152159 final Color colorMathBlockBorder; // TODO(#46) this won't be needed
153160 final Color colorMessageMediaContainerBackground;
@@ -209,6 +216,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
209216 Color ? colorDirectMentionBackground,
210217 Color ? colorGlobalTimeBackground,
211218 Color ? colorGlobalTimeBorder,
219+ Color ? colorHighlightBackground,
212220 Color ? colorLink,
213221 Color ? colorMathBlockBorder,
214222 Color ? colorMessageMediaContainerBackground,
@@ -232,6 +240,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
232240 colorDirectMentionBackground: colorDirectMentionBackground ?? this .colorDirectMentionBackground,
233241 colorGlobalTimeBackground: colorGlobalTimeBackground ?? this .colorGlobalTimeBackground,
234242 colorGlobalTimeBorder: colorGlobalTimeBorder ?? this .colorGlobalTimeBorder,
243+ colorHighlightBackground: colorHighlightBackground ?? this .colorHighlightBackground,
235244 colorLink: colorLink ?? this .colorLink,
236245 colorMathBlockBorder: colorMathBlockBorder ?? this .colorMathBlockBorder,
237246 colorMessageMediaContainerBackground: colorMessageMediaContainerBackground ?? this .colorMessageMediaContainerBackground,
@@ -262,6 +271,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
262271 colorDirectMentionBackground: Color .lerp (colorDirectMentionBackground, other.colorDirectMentionBackground, t)! ,
263272 colorGlobalTimeBackground: Color .lerp (colorGlobalTimeBackground, other.colorGlobalTimeBackground, t)! ,
264273 colorGlobalTimeBorder: Color .lerp (colorGlobalTimeBorder, other.colorGlobalTimeBorder, t)! ,
274+ colorHighlightBackground: Color .lerp (colorHighlightBackground, other.colorHighlightBackground, t)! ,
265275 colorLink: Color .lerp (colorLink, other.colorLink, t)! ,
266276 colorMathBlockBorder: Color .lerp (colorMathBlockBorder, other.colorMathBlockBorder, t)! ,
267277 colorMessageMediaContainerBackground: Color .lerp (colorMessageMediaContainerBackground, other.colorMessageMediaContainerBackground, t)! ,
@@ -1278,6 +1288,10 @@ class _InlineContentBuilder {
12781288 return WidgetSpan (alignment: PlaceholderAlignment .middle,
12791289 child: GlobalTime (node: node, ambientTextStyle: widget.style));
12801290
1291+ case HighlightNode ():
1292+ return _buildNodes (node.nodes,
1293+ style: TextStyle (backgroundColor: ContentTheme .of (_context! ).colorHighlightBackground));
1294+
12811295 case UnimplementedInlineContentNode ():
12821296 return _errorUnimplemented (node, context: _context! );
12831297 }
0 commit comments