-
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.
π :: b1nd-styled-components-theme μμ±
- Loading branch information
1 parent
7de60c0
commit 5eb17d9
Showing
24 changed files
with
965 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+31.3 KB
.yarn/cache/@yarnpkg-parsers-npm-3.0.0-rc.50-b4805cd702-6f7843e53f.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,20 @@ | ||
import "styled-components"; | ||
|
||
declare module "styled-components" { | ||
export interface B1ndTheme { | ||
backgroundColor: string; | ||
backgroundColor2: string; | ||
backgroundColor3: string; | ||
backgroundColor4: string; | ||
desableBackground: string; | ||
borderColor: string; | ||
borderColor2: string; | ||
contrast: string; | ||
contrast2: string; | ||
contrast3: string; | ||
hoverColor: string; | ||
headerBoxShadow: string; | ||
darkmodeButtonColor: string; | ||
footerBackground: string; | ||
} | ||
} |
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 @@ | ||
# b1nd-styled-components-theme |
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,19 @@ | ||
const { build } = require("esbuild"); | ||
const pkg = require("./package.json"); | ||
const { pnpPlugin } = require("@yarnpkg/esbuild-plugin-pnp"); | ||
|
||
const external = Object.keys({ | ||
...pkg.dependencies, | ||
...pkg.peerDependencies, | ||
}); | ||
|
||
build({ | ||
entryPoints: ["./src/index.ts"], | ||
outfile: pkg.main, | ||
format: "cjs", | ||
platform: "node", | ||
sourcemap: true, | ||
bundle: true, | ||
external: [...external], | ||
plugins: [pnpPlugin()], | ||
}).catch(() => process.exit(1)); |
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,31 @@ | ||
{ | ||
"name": "@b1nd/b1nd-styled-components-theme", | ||
"version": "1.0.0", | ||
"packageManager": "[email protected]", | ||
"description": "b1nd styled-components theme", | ||
"main": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"scripts": { | ||
"build": "npm run build:clean && npm run build:dist && npm run build:declaration", | ||
"build:clean": "rm -rf ./dist", | ||
"build:dist": "node esbuild.config.js", | ||
"build:declaration": "yarn pnpify tsc" | ||
}, | ||
"publishConfig": { | ||
"access": "public", | ||
"main": "./dist/index.js", | ||
"typings": "./dist/index.d.ts" | ||
}, | ||
"sideEffects": false, | ||
"author": "baekseungha <[email protected]>", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"@types/react": "^18", | ||
"@types/styled-components": "^5.1.26", | ||
"@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.15", | ||
"@yarnpkg/pnpify": "^4.0.0-rc.33", | ||
"esbuild": "^0.16.7", | ||
"react": "^18.2.0", | ||
"styled-components": "5.3.6" | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/b1nd-styled-components-theme/src/B1ndThemeProvider.tsx
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,17 @@ | ||
import { ThemeProvider } from "styled-components"; | ||
import { ReactNode } from "react"; | ||
import React from "react"; | ||
import { darkTheme, lightTheme } from "./b1ndTheme"; | ||
|
||
interface Props { | ||
children: ReactNode; | ||
mode: "LIGHT" | "DARK"; | ||
} | ||
|
||
export const B1ndThemeProvider = ({ children, mode }: Props) => { | ||
return ( | ||
<ThemeProvider theme={mode === "LIGHT" ? lightTheme : darkTheme}> | ||
{children} | ||
</ThemeProvider> | ||
); | ||
}; |
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,35 @@ | ||
import { B1ndTheme } from "styled-components"; | ||
|
||
export const lightTheme: B1ndTheme = { | ||
backgroundColor: "#f0f2f4", | ||
backgroundColor2: "#ffffff", | ||
backgroundColor3: "#ffffff", | ||
backgroundColor4: "#f0f2f4", | ||
desableBackground: "#f7f7f7", | ||
borderColor: "#d2d2d2", | ||
borderColor2: "#3d3d3d", | ||
contrast: "#000000", | ||
contrast2: "#5c5c5c", | ||
contrast3: "#a1a1a1", | ||
hoverColor: "#e2e2e2", | ||
headerBoxShadow: "0 1px 1px 0 hsl(0deg 0% 80% / 80%)", | ||
darkmodeButtonColor: "#efefef", | ||
footerBackground: "#292c33", | ||
}; | ||
|
||
export const darkTheme = { | ||
backgroundColor: "#1a1a1a", | ||
backgroundColor2: "#292929", | ||
backgroundColor3: "#1a1a1a", | ||
backgroundColor4: "#292929", | ||
desableBackground: "#1a1a1a", | ||
borderColor: "#3d3d3d", | ||
borderColor2: "#1a1a1a", | ||
contrast: "#ffffff", | ||
contrast2: "#e2e2e2", | ||
contrast3: "#ffffff", | ||
hoverColor: "#3d3d3d", | ||
headerBoxShadow: "0 1px 1px 0 rgba(61,61,61,.8)", | ||
darkmodeButtonColor: "#3d3d3d", | ||
footerBackground: "#292929", | ||
}; |
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,2 @@ | ||
export * from "./B1ndThemeProvider"; | ||
export * from "./b1ndTheme"; |
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,10 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"rootDir": "src", | ||
"outDir": "dist", | ||
"emitDeclarationOnly": true, | ||
"declaration": true | ||
}, | ||
"include": ["./src", "./@types"] | ||
} |
Oops, something went wrong.