Skip to content

Commit 0c1ce6f

Browse files
committed
chore: Update text styles (#13)
1 parent 31bc20a commit 0c1ce6f

File tree

19 files changed

+174
-56
lines changed

19 files changed

+174
-56
lines changed

example/lib/pages/theme/typography_example.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ class TypographyExample extends StatelessWidget {
2424
'Body Large': ZetaTextStyles.bodyLarge,
2525
'Body Medium': ZetaTextStyles.bodyMedium,
2626
'Body Small': ZetaTextStyles.bodySmall,
27+
'Body X-Small': ZetaTextStyles.bodyXSmall,
2728
'Label Large': ZetaTextStyles.labelLarge,
2829
'Label Medium': ZetaTextStyles.labelMedium,
2930
'Label Small': ZetaTextStyles.labelSmall,
3031
'Label Indicator': ZetaTextStyles.labelIndicator,
31-
'Label Tiny': ZetaTextStyles.labelTiny,
3232
};
3333

3434
return ExampleScaffold(

example/lib/widgets.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
22
import 'package:zeta_example/utils/theme_color_switch.dart';
33
import 'package:zeta_example/utils/theme_constrast_switch.dart';
44
import 'package:zeta_example/utils/theme_mode_switch.dart';
5-
import 'package:zeta_flutter/zeta_flutter.dart';
65

76
class ExampleScaffold extends StatelessWidget {
87
final String name;
@@ -29,10 +28,7 @@ class ExampleScaffold extends StatelessWidget {
2928
floatingActionButton: floatingActionButton,
3029
appBar: AppBar(
3130
centerTitle: false,
32-
title: Text(
33-
name,
34-
style: ZetaTextStyles.titleMedium,
35-
),
31+
title: Text(name),
3632
backgroundColor: colors.primary,
3733
foregroundColor: colors.onPrimary,
3834
actions: [

example/macos/Runner.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@
202202
isa = PBXProject;
203203
attributes = {
204204
LastSwiftUpdateCheck = 0920;
205-
LastUpgradeCheck = 1510;
205+
LastUpgradeCheck = 1430;
206206
ORGANIZATIONNAME = "";
207207
TargetAttributes = {
208208
33CC10EC2044A3C60003C045 = {

example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1510"
3+
LastUpgradeVersion = "1430"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

example/test/typography_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ void main() {
2424
Text(exampleText, style: ZetaTextStyles.displayLarge, key: key3),
2525
Text(
2626
exampleText,
27-
style: TextStyle(fontSize: 52, fontWeight: FontWeight.w300, height: 64 / 52),
27+
style: TextStyle(fontSize: 52, fontWeight: FontWeight.w300, height: 60 / 52),
2828
key: key4,
2929
),
3030
],
@@ -55,10 +55,10 @@ void main() {
5555
expect(text3.style, text4.style);
5656

5757
/// Test font size of [ZetaTextStyles.bodyMedium] is correct
58-
expect(text1.style!.fontSize, 14);
58+
expect(text1.style!.fontSize, 16);
5959

6060
/// Test line height of [ZetaTextStyles.bodyMedium] is correct
61-
expect(text1.style!.height, 20 / 14);
61+
expect(text1.style!.height, 24 / 16);
6262

6363
/// Test font weight of [ZetaTextStyles.bodyMedium] is correct
6464
expect(text1.style!.fontWeight, FontWeight.w400);

example/widgetbook/pages/theme/typography_widgetbook.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ const Map<String, TextStyle> allTypes = {
1616
'Body large': ZetaTextStyles.bodyLarge,
1717
'Body medium': ZetaTextStyles.bodyMedium,
1818
'Body small': ZetaTextStyles.bodySmall,
19+
'Body X-small': ZetaTextStyles.bodyXSmall,
1920
'Label large': ZetaTextStyles.labelLarge,
2021
'Label medium': ZetaTextStyles.labelMedium,
2122
'Label small': ZetaTextStyles.labelSmall,
2223
'Label indicator': ZetaTextStyles.labelIndicator,
23-
'Label tiny': ZetaTextStyles.labelTiny,
2424
};
2525

2626
Widget typographyUseCase(BuildContext context) => Padding(

lib/src/components/accordion/accordion.dart

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,17 @@ class _ZetaAccordionState extends State<ZetaAccordion> with TickerProviderStateM
174174
axisAlignment: -1,
175175
child: Padding(
176176
padding: const EdgeInsets.fromLTRB(ZetaSpacing.x4, 0, ZetaSpacing.x4, ZetaSpacing.x4),
177-
child: DefaultTextStyle(style: ZetaTextStyles.titleSmall, child: widget.child ?? const SizedBox()),
177+
child: Theme(
178+
data: Theme.of(context).copyWith(
179+
listTileTheme: ListTileThemeData(
180+
titleTextStyle: ZetaTextStyles.titleSmall.apply(color: zetaColors.textDefault),
181+
),
182+
),
183+
child: DefaultTextStyle(
184+
style: ZetaTextStyles.titleSmall,
185+
child: widget.child ?? const SizedBox(),
186+
),
187+
),
178188
),
179189
),
180190
],

lib/src/components/badges/indicator.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,10 @@ class ZetaIndicator extends StatelessWidget {
123123
return Center(
124124
child: Text(
125125
value.formatMaxChars(),
126-
style: (size == ZetaWidgetSize.large ? ZetaTextStyles.labelIndicator : ZetaTextStyles.labelTiny)
127-
.apply(color: foregroundColor),
126+
style: ZetaTextStyles.labelIndicator.copyWith(
127+
color: foregroundColor,
128+
fontSize: size == ZetaWidgetSize.large ? null : 11,
129+
), // TODO(thelukwalton): Awaiting updated design.
128130
),
129131
);
130132
}

lib/src/components/badges/priority_pill.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ class ZetaPriorityPill extends StatelessWidget {
4646
shape: rounded ? BoxShape.circle : BoxShape.rectangle,
4747
color: backgroundColor,
4848
),
49-
child: Text(index.formatMaxChars(), style: ZetaTextStyles.bodyMedium.apply(color: foregroundColor)),
49+
child: Text(index.formatMaxChars(), style: ZetaTextStyles.bodySmall.apply(color: foregroundColor)),
5050
),
5151
Padding(
5252
padding: const EdgeInsets.symmetric(horizontal: ZetaSpacing.x2, vertical: ZetaSpacing.x1),
5353
child: Text(
5454
priority,
55-
style: ZetaTextStyles.bodyMedium,
55+
style: ZetaTextStyles.bodySmall,
5656
overflow: TextOverflow.ellipsis,
5757
),
5858
),

lib/src/components/badges/workcloud_indicator.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class ZetaWorkcloudIndicator extends StatelessWidget {
103103
@override
104104
Widget build(BuildContext context) {
105105
final ZetaColorSwatch color = priorityType.color(context);
106-
final textStyle = prioritySize == ZetaWidgetSize.large ? ZetaTextStyles.labelMedium : ZetaTextStyles.labelTiny;
106+
final textStyle = prioritySize == ZetaWidgetSize.large ? ZetaTextStyles.bodySmall : ZetaTextStyles.bodyXSmall;
107107

108108
return DecoratedBox(
109109
decoration: BoxDecoration(

0 commit comments

Comments
 (0)