-
-
Notifications
You must be signed in to change notification settings - Fork 171
Refactor/use geist from google fonts #591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nank1ro
wants to merge
10
commits into
main
Choose a base branch
from
refactor/use-geist-from-google-fonts
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
90ed087
refactor: use geist from google fonts
nank1ro de618cb
remove print
nank1ro eee028a
revert main
nank1ro 00e40df
update imports
nank1ro 8d0bfef
use appropriate font family
nank1ro e852a1e
updates
nank1ro 36bc19d
fix: tests
nank1ro bd2b54d
chore: bump version
nank1ro b487cfd
chore: bump min dark sdk version
nank1ro 972b853
Merge branch 'main' into refactor/use-geist-from-google-fonts
nank1ro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,3 +8,4 @@ macos | |
| web | ||
| linux | ||
| fonts.zip | ||
| test/fonts | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,214 +1,163 @@ | ||
| import 'package:flutter/widgets.dart'; | ||
| import 'package:google_fonts/google_fonts.dart'; | ||
| import 'package:shadcn_ui/src/utils/extensions/text_style.dart'; | ||
|
|
||
| const kDefaultFontFamily = 'packages/shadcn_ui/Geist'; | ||
| const kDefaultFontFamilyMono = 'packages/shadcn_ui/GeistMono'; | ||
| const kDefaultFontFamily = 'Geist'; | ||
|
|
||
| abstract class ShadTextDefaultTheme { | ||
| static TextStyle h1Large({ | ||
| required String family, | ||
| }) { | ||
| return TextStyle( | ||
| static TextStyle h1Large() { | ||
| return GoogleFonts.geist( | ||
| fontSize: 48, | ||
| decoration: TextDecoration.none, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.w800, | ||
| height: 48 / 48, | ||
| letterSpacing: -0.4, | ||
| fontFamily: family, | ||
| textBaseline: TextBaseline.alphabetic, | ||
| leadingDistribution: TextLeadingDistribution.even, | ||
| ); | ||
| ).fallback(leadingDistribution: TextLeadingDistribution.even); | ||
| } | ||
|
|
||
| static TextStyle h1({ | ||
| required String family, | ||
| }) { | ||
| return TextStyle( | ||
| static TextStyle h1() { | ||
| return GoogleFonts.geist( | ||
| fontSize: 36, | ||
| decoration: TextDecoration.none, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.w800, | ||
| height: 40 / 36, | ||
| letterSpacing: -0.4, | ||
| fontFamily: family, | ||
| textBaseline: TextBaseline.alphabetic, | ||
| leadingDistribution: TextLeadingDistribution.even, | ||
| ); | ||
| ).fallback(leadingDistribution: TextLeadingDistribution.even); | ||
| } | ||
|
|
||
| static TextStyle h2({ | ||
| required String family, | ||
| }) { | ||
| return TextStyle( | ||
| static TextStyle h2() { | ||
| return GoogleFonts.geist( | ||
| fontSize: 30, | ||
| decoration: TextDecoration.none, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.w600, | ||
| height: 36 / 30, | ||
| letterSpacing: -0.4, | ||
| fontFamily: family, | ||
| textBaseline: TextBaseline.alphabetic, | ||
| leadingDistribution: TextLeadingDistribution.even, | ||
| ); | ||
| ).fallback(leadingDistribution: TextLeadingDistribution.even); | ||
| } | ||
|
|
||
| static TextStyle h3({ | ||
| required String family, | ||
| }) { | ||
| return TextStyle( | ||
| static TextStyle h3() { | ||
| return GoogleFonts.geist( | ||
| fontSize: 24, | ||
| decoration: TextDecoration.none, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.w600, | ||
| height: 32 / 24, | ||
| letterSpacing: -0.4, | ||
| fontFamily: family, | ||
| textBaseline: TextBaseline.alphabetic, | ||
| leadingDistribution: TextLeadingDistribution.even, | ||
| ); | ||
| ).fallback(leadingDistribution: TextLeadingDistribution.even); | ||
| } | ||
|
|
||
| static TextStyle h4({ | ||
| required String family, | ||
| }) { | ||
| return TextStyle( | ||
| static TextStyle h4() { | ||
| return GoogleFonts.geist( | ||
| fontSize: 20, | ||
| decoration: TextDecoration.none, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.w600, | ||
| height: 28 / 20, | ||
| letterSpacing: -0.4, | ||
| fontFamily: family, | ||
| textBaseline: TextBaseline.alphabetic, | ||
| leadingDistribution: TextLeadingDistribution.even, | ||
| ); | ||
| ).fallback(leadingDistribution: TextLeadingDistribution.even); | ||
| } | ||
|
|
||
| static TextStyle p({ | ||
| required String family, | ||
| }) { | ||
| return TextStyle( | ||
| static TextStyle p() { | ||
| return GoogleFonts.geist( | ||
| fontSize: 16, | ||
| decoration: TextDecoration.none, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.w400, | ||
| height: 28 / 16, | ||
| letterSpacing: 0, | ||
| fontFamily: family, | ||
| textBaseline: TextBaseline.alphabetic, | ||
| leadingDistribution: TextLeadingDistribution.even, | ||
| ); | ||
| ).fallback(leadingDistribution: TextLeadingDistribution.even); | ||
| } | ||
|
|
||
| static TextStyle blockquote({ | ||
| required String family, | ||
| }) { | ||
| return TextStyle( | ||
| static TextStyle blockquote() { | ||
| return GoogleFonts.geist( | ||
| fontSize: 16, | ||
| decoration: TextDecoration.none, | ||
| fontStyle: FontStyle.italic, | ||
| fontWeight: FontWeight.w400, | ||
| height: 24 / 16, | ||
| letterSpacing: 0, | ||
| fontFamily: family, | ||
| textBaseline: TextBaseline.alphabetic, | ||
| leadingDistribution: TextLeadingDistribution.even, | ||
| ); | ||
| ).fallback(leadingDistribution: TextLeadingDistribution.even); | ||
| } | ||
|
|
||
| static TextStyle table({ | ||
| required String family, | ||
| }) { | ||
| return TextStyle( | ||
| static TextStyle table() { | ||
| return GoogleFonts.geist( | ||
| fontSize: 16, | ||
| decoration: TextDecoration.none, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.w700, | ||
| height: 24 / 16, | ||
| letterSpacing: 0, | ||
| fontFamily: family, | ||
| textBaseline: TextBaseline.alphabetic, | ||
| leadingDistribution: TextLeadingDistribution.even, | ||
| ); | ||
| ).fallback(leadingDistribution: TextLeadingDistribution.even); | ||
| } | ||
|
|
||
| static TextStyle list({ | ||
| required String family, | ||
| }) { | ||
| return TextStyle( | ||
| static TextStyle list() { | ||
| return GoogleFonts.geist( | ||
| fontSize: 16, | ||
| decoration: TextDecoration.none, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.w400, | ||
| height: 24 / 16, | ||
| letterSpacing: 0, | ||
| fontFamily: family, | ||
| textBaseline: TextBaseline.alphabetic, | ||
| leadingDistribution: TextLeadingDistribution.even, | ||
| ); | ||
| ).fallback(leadingDistribution: TextLeadingDistribution.even); | ||
| } | ||
|
|
||
| static TextStyle lead({ | ||
| required String family, | ||
| }) { | ||
| return TextStyle( | ||
| static TextStyle lead() { | ||
| return GoogleFonts.geist( | ||
| fontSize: 20, | ||
| decoration: TextDecoration.none, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.w400, | ||
| height: 28 / 20, | ||
| letterSpacing: 0, | ||
| fontFamily: family, | ||
| textBaseline: TextBaseline.alphabetic, | ||
| leadingDistribution: TextLeadingDistribution.even, | ||
| ); | ||
| ).fallback(leadingDistribution: TextLeadingDistribution.even); | ||
| } | ||
|
|
||
| static TextStyle large({ | ||
| required String family, | ||
| }) { | ||
| return TextStyle( | ||
| static TextStyle large() { | ||
| return GoogleFonts.geist( | ||
| fontSize: 18, | ||
| decoration: TextDecoration.none, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.w600, | ||
| height: 28 / 18, | ||
| letterSpacing: 0, | ||
| fontFamily: family, | ||
| textBaseline: TextBaseline.alphabetic, | ||
| leadingDistribution: TextLeadingDistribution.even, | ||
| ); | ||
| ).fallback(leadingDistribution: TextLeadingDistribution.even); | ||
| } | ||
|
|
||
| static TextStyle small({ | ||
| required String family, | ||
| }) { | ||
| return TextStyle( | ||
| static TextStyle small() { | ||
| return GoogleFonts.geist( | ||
| fontSize: 14, | ||
| decoration: TextDecoration.none, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.w500, | ||
| height: 14 / 14, | ||
| letterSpacing: 0, | ||
| fontFamily: family, | ||
| textBaseline: TextBaseline.alphabetic, | ||
| leadingDistribution: TextLeadingDistribution.even, | ||
| ); | ||
| ).fallback(leadingDistribution: TextLeadingDistribution.even); | ||
| } | ||
|
|
||
| static TextStyle muted({ | ||
| required String family, | ||
| }) { | ||
| return TextStyle( | ||
| static TextStyle muted() { | ||
| return GoogleFonts.geist( | ||
| fontSize: 14, | ||
| decoration: TextDecoration.none, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.w400, | ||
| height: 20 / 14, | ||
| letterSpacing: 0, | ||
| fontFamily: family, | ||
| textBaseline: TextBaseline.alphabetic, | ||
| leadingDistribution: TextLeadingDistribution.even, | ||
| ); | ||
| ).fallback(leadingDistribution: TextLeadingDistribution.even); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: nank1ro/flutter-shadcn-ui
Length of output: 151
🏁 Script executed:
Repository: nank1ro/flutter-shadcn-ui
Length of output: 81
🏁 Script executed:
Repository: nank1ro/flutter-shadcn-ui
Length of output: 3149
🏁 Script executed:
Repository: nank1ro/flutter-shadcn-ui
Length of output: 220
Don't ignore assets that are declared in pubspec.yaml.
test/fontsis listed underflutter.assetsand the font files are declared influtter.fontsin pubspec.yaml (lines 45-87). Adding it to.pubignorewill exclude these font files from the published package, but the font declarations will remain. This causes missing-asset failures for consumers at runtime.Either keep the fonts in the published package or remove both the asset declarations and font definitions from pubspec.yaml if they're only for internal testing.
💡 Proposed fix (keep fonts published)
- test/fonts📝 Committable suggestion
🤖 Prompt for AI Agents