-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd4d8f0
commit 3c073f8
Showing
42 changed files
with
2,820 additions
and
150 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
/// <reference types="nativewind/types" /> |
This file contains 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 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 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 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 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; |
This file contains 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 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 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** @type {import('tailwindcss').Config} */ | ||
|
||
module.exports = { | ||
// NOTE: Update this to include the paths to all of your component files. | ||
content: ["./app/**/*.{js,jsx,ts,tsx}", "./components/**/*.{js,jsx,ts,tsx}"], | ||
presets: [require("nativewind/preset")], | ||
theme: { | ||
fontFamily: { | ||
body: "Inter_500Medium", | ||
}, | ||
extend: {}, | ||
}, | ||
plugins: [require("@unitools/font-plugin/expo")], | ||
}; |
This file contains 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
const plugin = require("tailwindcss/plugin"); | ||
|
||
function splitFontWeight(fontWeight) { | ||
const regex = /^([1-9]00)([a-zA-Z]+)$/; | ||
const match = fontWeight.match(regex); | ||
|
||
if (match) { | ||
return { | ||
numericWeight: match[1], | ||
textWeight: match[2], | ||
}; | ||
} | ||
} | ||
|
||
function parseFontString(fontString) { | ||
const regex = /^([^_]+)(?:_([^_]+))?(?:_([^_]+))?$/; | ||
const match = fontString.match(regex); | ||
|
||
if (match) { | ||
let fontConfiguration = {}; | ||
if (match[1]) { | ||
fontConfiguration.fontFamily = match[1].toLowerCase(); | ||
} | ||
if (match[2]) { | ||
const splittedFontWeight = splitFontWeight(match[2]); | ||
fontConfiguration.fontWeight = splittedFontWeight.numericWeight; | ||
} | ||
if (match[3]) { | ||
fontConfiguration.fontStyle = match[3].toLowerCase(); | ||
} | ||
return fontConfiguration; | ||
} | ||
} | ||
|
||
console.log("hahahahahahahahahaha normal"); | ||
|
||
module.exports = plugin(function ({ matchUtilities, theme, e }) { | ||
console.log("hahahahahahahahahaha insdie"); | ||
matchUtilities( | ||
{ | ||
font: (val) => { | ||
const parsedFonts = parseFontString(val); | ||
return parsedFonts; | ||
}, | ||
}, | ||
{ | ||
values: theme("fontFamily"), | ||
} | ||
); | ||
}); |
This file contains 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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
const plugin = require("tailwindcss/plugin"); | ||
|
||
function splitFontWeight(fontWeight) { | ||
const regex = /^([1-9]00)([a-zA-Z]+)$/; | ||
const match = fontWeight.match(regex); | ||
|
||
if (match) { | ||
return { | ||
numericWeight: match[1], | ||
textWeight: match[2], | ||
}; | ||
} | ||
} | ||
|
||
function parseFontString(fontString) { | ||
const regex = /^([^_]+)(?:_([^_]+))?(?:_([^_]+))?$/; | ||
const match = fontString.match(regex); | ||
|
||
if (match) { | ||
let fontConfiguration = {}; | ||
if (match[1]) { | ||
fontConfiguration.fontFamily = match[1].toLowerCase(); | ||
} | ||
if (match[2]) { | ||
const splittedFontWeight = splitFontWeight(match[2]); | ||
fontConfiguration.fontWeight = splittedFontWeight.numericWeight; | ||
} | ||
if (match[3]) { | ||
fontConfiguration.fontStyle = match[3].toLowerCase(); | ||
} | ||
return fontConfiguration; | ||
} | ||
} | ||
|
||
module.exports = plugin(function ({ matchUtilities, theme, e }) { | ||
matchUtilities( | ||
{ | ||
font: (val) => { | ||
const parsedFonts = parseFontString(val); | ||
|
||
return parsedFonts; | ||
}, | ||
}, | ||
{ | ||
values: theme("fontFamily"), | ||
} | ||
); | ||
}); |
This file contains 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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
const plugin = require("tailwindcss/plugin"); | ||
|
||
const fff = plugin(function ({ addUtilities, theme, e }) { | ||
const fonts = theme("fontFamily"); | ||
const ogFontWeight = theme("fontWeight"); | ||
|
||
let modifiedFontFamily = {}; | ||
|
||
Object.keys(ogFontWeight).forEach((fw) => { | ||
let updatedFw = fw; | ||
|
||
if (ogFontWeight[fw] === "400") updatedFw = "regular"; | ||
modifiedFontFamily[fw] = | ||
`${ogFontWeight[fw]}${updatedFw.charAt(0).toUpperCase()}${updatedFw.slice(1)}`; | ||
}); | ||
|
||
const combinedUtilities = {}; | ||
|
||
const fontStyles = { | ||
italic: "Italic", | ||
}; | ||
|
||
Object.entries(fonts).forEach(([fontName, fontValue]) => { | ||
const capitalizedFontName = | ||
fontValue.charAt(0).toUpperCase() + fontValue.slice(1); | ||
const defaultClassName = `.${e(`font-${fontName}`)}`; | ||
combinedUtilities[defaultClassName] = { | ||
fontFamily: `${capitalizedFontName}_400Regular`, | ||
}; | ||
const italicDefaultClassName = `.${e(`font-${fontName}`)}.${e(`font-${fontStyles["italic"]}`)}`; | ||
combinedUtilities[italicDefaultClassName] = { | ||
fontFamily: `${capitalizedFontName}_400Regular_Italic`, | ||
}; | ||
Object.entries(modifiedFontFamily).forEach( | ||
([weightValue, weightSuffix]) => { | ||
Object.entries(fontStyles).forEach(([styleName, styleSuffix]) => { | ||
const className = `.${e(`font-${fontName}`)}.${e(`font-${weightValue}`)}.${e(`font-${styleName}`)}`; | ||
combinedUtilities[className] = { | ||
fontFamily: `${capitalizedFontName}_${weightSuffix}_${styleSuffix}`, | ||
}; | ||
|
||
const regularClassName = `.${e(`font-${fontName}`)}.${e(`font-${weightValue}`)}`; | ||
combinedUtilities[regularClassName] = { | ||
fontFamily: `${capitalizedFontName}_${weightSuffix}`, | ||
}; | ||
}); | ||
} | ||
); | ||
}); | ||
|
||
addUtilities(combinedUtilities); | ||
}); | ||
|
||
export default fff; |
This file contains 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 |
---|---|---|
|
@@ -48,3 +48,7 @@ a { | |
color: inherit; | ||
text-decoration: none; | ||
} | ||
|
||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; |
This file contains 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,23 +1,31 @@ | ||
import React = require("react"); | ||
"use client"; | ||
|
||
import { Inter } from "next/font/google"; | ||
import { useFonts } from "@unitools/fonts-loader"; | ||
import "./globals.css"; | ||
import type { Metadata } from "next"; | ||
// import { Inter } from "next/font/google"; | ||
import { GluestackUIProvider } from "@/components/ui/gluestack-ui-provider"; | ||
|
||
// const inter = Inter({ subsets: ["latin"] }); | ||
const inter1 = useFonts(); | ||
|
||
export const metadata: Metadata = { | ||
title: "Create Turborepo", | ||
description: "Generated by create turbo", | ||
}; | ||
const inter = Inter({ | ||
weight: ["100", "500", "600"], | ||
subsets: ["latin"], | ||
variable: "--inter", | ||
}); | ||
|
||
import StyledJsxRegistry from "./registry"; | ||
export default function RootLayout({ | ||
children, | ||
}: { | ||
}: Readonly<{ | ||
children: React.ReactNode; | ||
}): JSX.Element { | ||
}>) { | ||
return ( | ||
<html lang="en"> | ||
<body>{children}</body> | ||
<body className={inter.variable} style={{ display: "flex" }}> | ||
<StyledJsxRegistry> | ||
<GluestackUIProvider mode="light">{children}</GluestackUIProvider> | ||
</StyledJsxRegistry> | ||
</body> | ||
</html> | ||
); | ||
} |
This file contains 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
Oops, something went wrong.