bundle Josefin Sans as the default UI face at weight 300
Vendor the JosefinSans variable font (upright + italic, weight range 100-700), OFL licensed. _AppRoot installs it as the ambient DefaultTextStyle at weight w300 (Light); ClideText inherits rather than re-specifying the family, so Alchemist's Ahem injection keeps goldens deterministic per D-024 while production renders the intended face. typography.dart gains clideUiFamily + clideUiFamilyFallback alongside the existing mono constants; .gitignore learns about Alchemist's failures/ diff output dir so local re-runs don't leak into `git status`. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,14 +1,22 @@
|
||||
import 'package:clide_app/kernel/src/theme/controller.dart';
|
||||
import 'package:clide_app/widgets/src/typography.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
/// Theme-aware Text. Defaults pull from the global foreground token.
|
||||
/// Theme-aware Text. Defaults pull from the global foreground token
|
||||
/// and [clideUiDefaultWeight].
|
||||
///
|
||||
/// The UI font family is deliberately **not** set on this widget — it
|
||||
/// inherits from the ambient `DefaultTextStyle` which `_AppRoot`
|
||||
/// provides ([clideUiFamily] in real runs). Goldens rely on Alchemist
|
||||
/// injecting Ahem for deterministic metrics; hard-coding a family here
|
||||
/// would override that and break pixel determinism per D-024.
|
||||
class ClideText extends StatelessWidget {
|
||||
const ClideText(
|
||||
this.data, {
|
||||
super.key,
|
||||
this.color,
|
||||
this.fontSize = 13,
|
||||
this.fontWeight = FontWeight.w400,
|
||||
this.fontWeight,
|
||||
this.muted = false,
|
||||
this.maxLines,
|
||||
this.overflow,
|
||||
@@ -18,7 +26,7 @@ class ClideText extends StatelessWidget {
|
||||
final String data;
|
||||
final Color? color;
|
||||
final double fontSize;
|
||||
final FontWeight fontWeight;
|
||||
final FontWeight? fontWeight;
|
||||
final bool muted;
|
||||
final int? maxLines;
|
||||
final TextOverflow? overflow;
|
||||
@@ -37,8 +45,11 @@ class ClideText extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
color: resolved,
|
||||
fontSize: fontSize,
|
||||
// Null means inherit from the ambient DefaultTextStyle —
|
||||
// _AppRoot installs clideUiDefaultWeight there; goldens get
|
||||
// whatever Alchemist injects. Passing an explicit weight (e.g.
|
||||
// FontWeight.bold) still wins.
|
||||
fontWeight: fontWeight,
|
||||
fontFamilyFallback: const ['Inter', 'Helvetica', 'Arial', 'sans-serif'],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user