App: keep the Terminal text theme in its own file

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 16:47:15 +00:00
parent ca2f7eee32
commit 0599d6dc23
2 changed files with 36 additions and 32 deletions
+1 -32
View File
@@ -6,6 +6,7 @@ import 'app_design.dart';
import 'app_design_tokens.dart'; import 'app_design_tokens.dart';
import 'app_theme.dart'; import 'app_theme.dart';
import 'terminal_palette.dart'; import 'terminal_palette.dart';
import 'terminal_typography.dart';
/// Terminal's corner radius: square enough to read as a terminal frame, soft /// Terminal's corner radius: square enough to read as a terminal frame, soft
/// enough not to alias. /// enough not to alias.
@@ -228,35 +229,3 @@ ThemeData terminalTheme(Brightness brightness) {
), ),
); );
} }
/// [base] in the monospace family at a terminal's compact size: Material's
/// roles a step smaller (monospace runs wide), with no added letter spacing.
TextTheme terminalTextTheme(TextTheme base) {
TextStyle? mono(TextStyle? style) {
if (style == null) return null;
final size = style.fontSize;
return style.copyWith(
fontFamily: appMonospaceFamily,
fontSize: size == null ? null : (size * 0.875).roundToDouble(),
letterSpacing: 0,
);
}
return base.copyWith(
displayLarge: mono(base.displayLarge),
displayMedium: mono(base.displayMedium),
displaySmall: mono(base.displaySmall),
headlineLarge: mono(base.headlineLarge),
headlineMedium: mono(base.headlineMedium),
headlineSmall: mono(base.headlineSmall),
titleLarge: mono(base.titleLarge),
titleMedium: mono(base.titleMedium),
titleSmall: mono(base.titleSmall),
bodyLarge: mono(base.bodyLarge),
bodyMedium: mono(base.bodyMedium),
bodySmall: mono(base.bodySmall),
labelLarge: mono(base.labelLarge),
labelMedium: mono(base.labelMedium),
labelSmall: mono(base.labelSmall),
);
}
+35
View File
@@ -0,0 +1,35 @@
import 'package:flutter/material.dart';
import '../text/monospace.dart';
/// [base] in the monospace family at a terminal's compact size: Material's
/// roles a step smaller (monospace runs wide), with no added letter spacing.
TextTheme terminalTextTheme(TextTheme base) {
TextStyle? mono(TextStyle? style) {
if (style == null) return null;
final size = style.fontSize;
return style.copyWith(
fontFamily: appMonospaceFamily,
fontSize: size == null ? null : (size * 0.875).roundToDouble(),
letterSpacing: 0,
);
}
return base.copyWith(
displayLarge: mono(base.displayLarge),
displayMedium: mono(base.displayMedium),
displaySmall: mono(base.displaySmall),
headlineLarge: mono(base.headlineLarge),
headlineMedium: mono(base.headlineMedium),
headlineSmall: mono(base.headlineSmall),
titleLarge: mono(base.titleLarge),
titleMedium: mono(base.titleMedium),
titleSmall: mono(base.titleSmall),
bodyLarge: mono(base.bodyLarge),
bodyMedium: mono(base.bodyMedium),
bodySmall: mono(base.bodySmall),
labelLarge: mono(base.labelLarge),
labelMedium: mono(base.labelMedium),
labelSmall: mono(base.labelSmall),
);
}