Skip to content

Commit

Permalink
match typography specifications
Browse files Browse the repository at this point in the history
* add xSmallBold
* update home page of package
  • Loading branch information
smallTrogdor committed Feb 14, 2024
1 parent 23485ae commit 136ea1f
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 29 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* Added `SBBNotificationBox`
* Added `SBBStatusMobile`
* Added global function `showCustomSBBModalSheet`
* Added `SBBTextStyles.extraSmallBold` to match current specifications
* `SBBPrimaryButton`: Added different theme based on hostType (for web)
* `SBBTheme`:Added field `hostType`
* `SBBIcons`: Added new icons
Expand Down
3 changes: 3 additions & 0 deletions example/lib/pages/typography_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ class TypographyPage extends StatelessWidget {
const SizedBox(height: sbbDefaultSpacing),
const TypographyExample(
'Extra Small (Light)', SBBTextStyles.extraSmallLight),
const SizedBox(height: sbbDefaultSpacing),
const TypographyExample(
'Extra Small (Bold)', SBBTextStyles.extraSmallBold),
],
);
}
Expand Down
26 changes: 13 additions & 13 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
url: "https://pub.dev"
source: hosted
version: "1.18.0"
version: "1.17.2"
convert:
dependency: transitive
description:
Expand Down Expand Up @@ -347,10 +347,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
url: "https://pub.dev"
source: hosted
version: "1.10.0"
version: "1.9.1"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -472,18 +472,18 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
url: "https://pub.dev"
source: hosted
version: "1.11.1"
version: "1.11.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
version: "2.1.1"
stream_transform:
dependency: transitive
description:
Expand Down Expand Up @@ -512,10 +512,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
url: "https://pub.dev"
source: hosted
version: "0.6.1"
version: "0.6.0"
timing:
dependency: transitive
description:
Expand Down Expand Up @@ -576,10 +576,10 @@ packages:
dependency: transitive
description:
name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
url: "https://pub.dev"
source: hosted
version: "0.3.0"
version: "0.1.4-beta"
web_socket_channel:
dependency: transitive
description:
Expand All @@ -605,5 +605,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.2.0-194.0.dev <4.0.0"
dart: ">=3.1.0-185.0.dev <4.0.0"
flutter: ">=3.7.0-0"
14 changes: 12 additions & 2 deletions lib/src/theme/sbb_typography.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ class SBBTextStyles {
static const double largeFontSize = 18.0;
static const double mediumFontSize = 16.0;
static const double smallFontSize = 14.0;
static const double xSmallFontSize = 12.0;

static const double largeFontHeight = 24.0 / largeFontSize;
static const double mediumFontHeight = 20.0 / mediumFontSize;
static const double smallFontHeight = 20.0 / smallFontSize;
static const double xSmallFontHeight = 16.0 / smallFontSize;

static const TextStyle extraLargeLight = TextStyle(
fontSize: 30.0,
Expand Down Expand Up @@ -73,13 +75,21 @@ class SBBTextStyles {
);

static const TextStyle extraSmallLight = TextStyle(
fontSize: 12.0,
height: 16.0 / 12.0,
fontSize: xSmallFontSize,
height: xSmallFontHeight,
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w300,
fontFamily: SBBWebFont,
);

static const TextStyle extraSmallBold = TextStyle(
fontSize: xSmallFontSize,
height: xSmallFontHeight,
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w700,
fontFamily: SBBWebFont,
);

static const TextStyle helpersLabel = TextStyle(
fontSize: 10.0,
height: 12.0 / 10.0,
Expand Down
26 changes: 13 additions & 13 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
url: "https://pub.dev"
source: hosted
version: "1.18.0"
version: "1.17.2"
fake_async:
dependency: transitive
description:
Expand Down Expand Up @@ -95,10 +95,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
url: "https://pub.dev"
source: hosted
version: "1.10.0"
version: "1.9.1"
path:
dependency: transitive
description:
Expand All @@ -124,18 +124,18 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
url: "https://pub.dev"
source: hosted
version: "1.11.1"
version: "1.11.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
version: "2.1.1"
string_scanner:
dependency: transitive
description:
Expand All @@ -156,10 +156,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
url: "https://pub.dev"
source: hosted
version: "0.6.1"
version: "0.6.0"
vector_math:
dependency: transitive
description:
Expand All @@ -172,9 +172,9 @@ packages:
dependency: transitive
description:
name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
url: "https://pub.dev"
source: hosted
version: "0.3.0"
version: "0.1.4-beta"
sdks:
dart: ">=3.2.0-194.0.dev <4.0.0"
dart: ">=3.1.0 <4.0.0"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: design_system_flutter
description: Design System Mobile for Flutter
version: 1.2.0
homepage: https://mob.sbb.ch
homepage: https://digital.sbb.ch/de/design-system/mobile/overview/

environment:
sdk: '>=3.0.0 <4.0.0'
Expand Down

0 comments on commit 136ea1f

Please sign in to comment.