-
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 #1 from flodlc/dev-ci
add test in ci
- Loading branch information
Showing
11 changed files
with
1,021 additions
and
43 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
Large diffs are not rendered by default.
Oops, something went wrong.
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 +1,9 @@ | ||
# themebox | ||
## Themebox | ||
### themebox is a lightweight (1kb compressed) library that provides tools for theming. | ||
|
||
### `Installation` | ||
``` | ||
npm install themebox | ||
``` | ||
|
||
### `usage` |
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
"main": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
"type": "commonjs", | ||
"packageManager": "[email protected].2", | ||
"packageManager": "[email protected].1", | ||
"version": "0.1.0", | ||
"scripts": { | ||
"dev": "run-p --continue-on-error watch:source watch: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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "playground", | ||
"packageManager": "[email protected].2", | ||
"packageManager": "[email protected].1", | ||
"private": true, | ||
"type": "commonjs", | ||
"scripts": { | ||
|
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,44 +1,52 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom/client'; | ||
import { Box, theme, ThemeProvider } from 'themebox'; | ||
import { Box, ThemeProvider } from 'themebox'; | ||
|
||
import { Card } from './Card'; | ||
import { theme } from './theme'; | ||
|
||
ReactDOM.createRoot(document.getElementById('root')!).render( | ||
<React.StrictMode> | ||
<ThemeProvider theme={theme}> | ||
<Box | ||
sx={{ | ||
display: 'flex', | ||
flexDirection: ['column', null, 'row'], | ||
}} | ||
> | ||
const Wrapper = () => { | ||
return ( | ||
<> | ||
{new Array(1).fill(0).map((od, i) => ( | ||
<Box | ||
sx={[ | ||
{ | ||
key={i} | ||
sx={{ | ||
display: 'flex', | ||
flexDirection: ['column', null, 'row'], | ||
}} | ||
> | ||
<Box | ||
sx={[ | ||
{ | ||
background: 'primary', | ||
p: 4, | ||
color: 'primary', | ||
flex: 1, | ||
m: 2, | ||
}, | ||
]} | ||
> | ||
hey | ||
</Box> | ||
<Box | ||
sx={{ | ||
background: 'blue', | ||
p: 4, | ||
color: 'white', | ||
flex: 1, | ||
m: 2, | ||
}, | ||
]} | ||
> | ||
My box | ||
</Box> | ||
<Box | ||
sx={{ | ||
background: 'blue', | ||
p: 4, | ||
color: 'white', | ||
flex: 1, | ||
m: 2, | ||
}} | ||
> | ||
My box | ||
}} | ||
/> | ||
<Card sx={{ flex: 1, m: 2, boxShadow: 1 }}>My Card</Card> | ||
</Box> | ||
<Card sx={{ flex: 1, m: 2 }}>My Card</Card> | ||
</Box> | ||
</ThemeProvider> | ||
</React.StrictMode> | ||
))} | ||
</> | ||
); | ||
}; | ||
|
||
ReactDOM.createRoot(document.getElementById('root')!).render( | ||
<ThemeProvider theme={theme}> | ||
<Wrapper /> | ||
</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,8 @@ | ||
import { defaultTheme } from 'themebox'; | ||
|
||
export const theme = { | ||
...defaultTheme, | ||
colors: { | ||
primary: 'grey', | ||
}, | ||
}; |
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,7 +1,8 @@ | ||
import type { Theme as DTheme } from './index'; | ||
import { theme } from './theme'; | ||
|
||
declare module '@emotion/react' { | ||
export interface Theme extends DTheme { | ||
f: undefined; | ||
} | ||
type CustomTheme = typeof theme; | ||
|
||
declare module 'themebox' { | ||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
export interface Theme extends CustomTheme {} | ||
} |
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