-
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
e91c2ca
commit 1395d2f
Showing
22 changed files
with
762 additions
and
767 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 |
---|---|---|
@@ -1,22 +1,22 @@ | ||
{ | ||
"editor.codeActionsOnSave": { | ||
"quickfix.biome": "explicit", | ||
"source.organizeImports.biome": "explicit" | ||
}, | ||
"editor.defaultFormatter": "biomejs.biome", | ||
"[javascript]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[javascriptreact]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[typescriptreact]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[json]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
} | ||
"editor.codeActionsOnSave": { | ||
"quickfix.biome": "explicit", | ||
"source.organizeImports.biome": "explicit" | ||
}, | ||
"editor.defaultFormatter": "biomejs.biome", | ||
"[javascript]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[javascriptreact]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[typescriptreact]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[json]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
} | ||
} |
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,34 +1,35 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.9.3/schema.json", | ||
"vcs": { | ||
"enabled": false, | ||
"clientKind": "git", | ||
"useIgnoreFile": false | ||
}, | ||
"files": { | ||
"ignoreUnknown": false, | ||
"ignore": ["node_modules", "dist", ".next"] | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"indentStyle": "tab" | ||
}, | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true, | ||
"correctness": { | ||
"noUnusedImports": "error" | ||
} | ||
} | ||
}, | ||
"javascript": { | ||
"jsxRuntime": "reactClassic", | ||
"formatter": { | ||
"quoteStyle": "double" | ||
} | ||
} | ||
"$schema": "https://biomejs.dev/schemas/1.9.3/schema.json", | ||
"vcs": { | ||
"enabled": false, | ||
"clientKind": "git", | ||
"useIgnoreFile": false | ||
}, | ||
"files": { | ||
"ignoreUnknown": false, | ||
"ignore": ["node_modules", "dist", ".next"] | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"indentStyle": "space", | ||
"indentWidth": 2 | ||
}, | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true, | ||
"correctness": { | ||
"noUnusedImports": "error" | ||
} | ||
} | ||
}, | ||
"javascript": { | ||
"jsxRuntime": "reactClassic", | ||
"formatter": { | ||
"quoteStyle": "double" | ||
} | ||
} | ||
} |
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,23 @@ | ||
{ | ||
"name": "example", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "next build", | ||
"start": "next start", | ||
"lint": "next lint" | ||
}, | ||
"dependencies": { | ||
"just-styled": "file:../", | ||
"react": "19.0.0-rc-f994737d14-20240522", | ||
"react-dom": "19.0.0-rc-f994737d14-20240522", | ||
"next": "15.0.0-rc.0" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^5", | ||
"@types/node": "^20", | ||
"@types/react": "^18", | ||
"@types/react-dom": "^18" | ||
} | ||
"name": "example", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "next build", | ||
"start": "next start", | ||
"lint": "next lint" | ||
}, | ||
"dependencies": { | ||
"just-styled": "file:../", | ||
"react": "19.0.0-rc-f994737d14-20240522", | ||
"react-dom": "19.0.0-rc-f994737d14-20240522", | ||
"next": "15.0.0-rc.0" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^5", | ||
"@types/node": "^20", | ||
"@types/react": "^18", | ||
"@types/react-dom": "^18" | ||
} | ||
} |
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,72 +1,72 @@ | ||
import { Box, styled } from "just-styled"; | ||
|
||
export default function Home() { | ||
return ( | ||
<Box | ||
style={{ | ||
display: "flex", | ||
flexDirection: "column", | ||
gap: "$spaces.sm", | ||
padding: "$spaces.md", | ||
}} | ||
> | ||
<WithStyledFunction /> | ||
<WithBoxComponent /> | ||
<WithSemanticToken /> | ||
<WithPseudoSelector /> | ||
<WithMediaQuery /> | ||
</Box> | ||
); | ||
return ( | ||
<Box | ||
style={{ | ||
display: "flex", | ||
flexDirection: "column", | ||
gap: "$spaces.sm", | ||
padding: "$spaces.md", | ||
}} | ||
> | ||
<WithStyledFunction /> | ||
<WithBoxComponent /> | ||
<WithSemanticToken /> | ||
<WithPseudoSelector /> | ||
<WithMediaQuery /> | ||
</Box> | ||
); | ||
} | ||
|
||
const StyledBox = styled("div", { | ||
backgroundColor: "$colors.red.200", | ||
backgroundColor: "$colors.red.200", | ||
}); | ||
|
||
export function WithStyledFunction() { | ||
return <StyledBox>Styled using styled function</StyledBox>; | ||
return <StyledBox>Styled using styled function</StyledBox>; | ||
} | ||
|
||
export function WithBoxComponent() { | ||
return ( | ||
<Box style={{ color: "$colors.gray.600", border: "1px solid black" }}> | ||
Inline styling using builtin Box component | ||
</Box> | ||
); | ||
return ( | ||
<Box style={{ color: "$colors.gray.600", border: "1px solid black" }}> | ||
Inline styling using builtin Box component | ||
</Box> | ||
); | ||
} | ||
|
||
export function WithSemanticToken() { | ||
return ( | ||
<Box style={{ color: "$colors.primary", backgroundColor: "$colors.bg" }}> | ||
Styled using semantic tokens which refers other tokens | ||
</Box> | ||
); | ||
return ( | ||
<Box style={{ color: "$colors.primary", backgroundColor: "$colors.bg" }}> | ||
Styled using semantic tokens which refers other tokens | ||
</Box> | ||
); | ||
} | ||
|
||
export function WithPseudoSelector() { | ||
return ( | ||
<Box | ||
style={{ | ||
color: "$colors.red.200", | ||
":hover": { color: "$colors.red.600", backgroundColor: "$colors.bg" }, | ||
}} | ||
> | ||
Styled using :hover pseudo selector | ||
</Box> | ||
); | ||
return ( | ||
<Box | ||
style={{ | ||
color: "$colors.red.200", | ||
":hover": { color: "$colors.red.600", backgroundColor: "$colors.bg" }, | ||
}} | ||
> | ||
Styled using :hover pseudo selector | ||
</Box> | ||
); | ||
} | ||
|
||
export function WithMediaQuery() { | ||
return ( | ||
<Box | ||
style={{ | ||
backgroundColor: "$colors.red.200", | ||
"@media (max-width: 768px)": { | ||
backgroundColor: "$colors.gray.200", | ||
}, | ||
}} | ||
> | ||
Styled using media query (red in 768px or larger width, otherwise gray) | ||
</Box> | ||
); | ||
return ( | ||
<Box | ||
style={{ | ||
backgroundColor: "$colors.red.200", | ||
"@media (max-width: 768px)": { | ||
backgroundColor: "$colors.gray.200", | ||
}, | ||
}} | ||
> | ||
Styled using media query (red in 768px or larger width, otherwise gray) | ||
</Box> | ||
); | ||
} |
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,24 +1,24 @@ | ||
import { defineConfig } from "just-styled"; | ||
|
||
export const config = defineConfig({ | ||
tokens: { | ||
colors: { | ||
"gray.200": "#eeeeee", | ||
"gray.600": "#555555", | ||
"red.200": "#EB7076", | ||
"red.600": "#E02932", | ||
primary: "$colors.red.600", | ||
bg: "$colors.gray.200", | ||
}, | ||
spaces: { | ||
sm: "8px", | ||
md: "16px", | ||
}, | ||
}, | ||
tokens: { | ||
colors: { | ||
"gray.200": "#eeeeee", | ||
"gray.600": "#555555", | ||
"red.200": "#EB7076", | ||
"red.600": "#E02932", | ||
primary: "$colors.red.600", | ||
bg: "$colors.gray.200", | ||
}, | ||
spaces: { | ||
sm: "8px", | ||
md: "16px", | ||
}, | ||
}, | ||
}); | ||
|
||
type UserConfig = typeof config; | ||
declare module "just-styled" { | ||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
export interface JustStyledConfig extends UserConfig {} | ||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
export interface JustStyledConfig extends UserConfig {} | ||
} |
Oops, something went wrong.