@@ -15,9 +15,9 @@ import 'content.dart';
15
15
/// and applies the CSS styles defined in .katex class in katex.scss :
16
16
/// https://github.com/KaTeX/KaTeX/blob/613c3da8/src/styles/katex.scss#L13-L15
17
17
///
18
- /// Requires the [style .fontSize] to be non-null.
19
- TextStyle mkBaseKatexTextStyle (TextStyle style , Color baseColor) {
20
- return style .copyWith (
18
+ /// Requires the [ambientStyle .fontSize] to be non-null.
19
+ TextStyle mkBaseKatexTextStyle (TextStyle ambientStyle , Color baseColor) {
20
+ return ambientStyle .copyWith (
21
21
////// Overrides of our own styles:
22
22
23
23
// Bold formatting is removed below by setting FontWeight.normal…
@@ -32,7 +32,7 @@ TextStyle mkBaseKatexTextStyle(TextStyle style, Color baseColor) {
32
32
33
33
////// From the .katex class in katex.scss:
34
34
35
- fontSize: style .fontSize! * 1.21 ,
35
+ fontSize: ambientStyle .fontSize! * 1.21 ,
36
36
fontFamily: 'KaTeX_Main' ,
37
37
height: 1.2 ,
38
38
fontWeight: FontWeight .normal,
@@ -47,11 +47,11 @@ TextStyle mkBaseKatexTextStyle(TextStyle style, Color baseColor) {
47
47
class KatexWidget extends StatelessWidget {
48
48
const KatexWidget ({
49
49
super .key,
50
- required this .textStyle ,
50
+ required this .ambientTextStyle ,
51
51
required this .nodes,
52
52
});
53
53
54
- final TextStyle textStyle ;
54
+ final TextStyle ambientTextStyle ;
55
55
final List <KatexNode > nodes;
56
56
57
57
@override
@@ -61,7 +61,7 @@ class KatexWidget extends StatelessWidget {
61
61
return Directionality (
62
62
textDirection: TextDirection .ltr,
63
63
child: DefaultTextStyle (
64
- style: mkBaseKatexTextStyle (textStyle ,
64
+ style: mkBaseKatexTextStyle (ambientTextStyle ,
65
65
ContentTheme .of (context).textStylePlainParagraph.color! ),
66
66
child: widget));
67
67
}
0 commit comments