generated from react18-tools/turborepo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from react18-tools/minify
Minify
- Loading branch information
Showing
10 changed files
with
60 additions
and
40 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
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,5 +1,6 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
/// <reference types="next/navigation-types/compat/navigation" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |
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
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,28 @@ | ||
import { ColorSchemePreference, ResolvedScheme } from "../../utils"; | ||
|
||
declare global { | ||
// skipcq: JS-0102, JS-C1002, JS-0239 | ||
var u: (mode: ColorSchemePreference, systemMode: ResolvedScheme) => void; | ||
// skipcq: JS-0102, JS-C1002, JS-0239 | ||
var m: MediaQueryList; | ||
} | ||
|
||
/** function to be injected in script tag for avoiding FOUC */ | ||
export const noFOUCScript = (storageKey: string) => { | ||
const [SYSTEM, DARK] = ["system", "dark"] as const; | ||
window.u = (mode: ColorSchemePreference, systemMode: ResolvedScheme) => { | ||
const resolvedMode = mode === SYSTEM ? systemMode : mode; | ||
const el = document.documentElement; | ||
if (resolvedMode === DARK) el.classList.add(DARK); | ||
else el.classList.remove(DARK); | ||
[ | ||
["sm", systemMode], | ||
["rm", resolvedMode], | ||
["m", mode], | ||
].forEach(([dataLabel, value]) => el.setAttribute(`data-${dataLabel}`, value)); | ||
// System mode is decided by current system state and need not be stored in localStorage | ||
localStorage.setItem(storageKey, mode); | ||
}; | ||
window.m = matchMedia(`(prefers-color-scheme: ${DARK})`); | ||
u((localStorage.getItem(storageKey) ?? SYSTEM) as ColorSchemePreference, m.matches ? DARK : ""); | ||
}; |
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,5 +1,12 @@ | ||
# @repo/shared | ||
|
||
## 0.0.12 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies [4cc739a] | ||
- [email protected] | ||
|
||
## 0.0.11 | ||
|
||
### Patch Changes | ||
|
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