Skip to content

Commit

Permalink
use space instead of tab for indent
Browse files Browse the repository at this point in the history
  • Loading branch information
yukukotani committed Oct 19, 2024
1 parent e91c2ca commit 1395d2f
Show file tree
Hide file tree
Showing 22 changed files with 762 additions and 767 deletions.
40 changes: 20 additions & 20 deletions .vscode/settings.json
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"
}
}
65 changes: 33 additions & 32 deletions biome.json
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"
}
}
}
42 changes: 21 additions & 21 deletions example/package.json
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"
}
}
22 changes: 11 additions & 11 deletions example/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ import type { Metadata } from "next";
import { config } from "../theme-config";

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
title: "Create Next App",
description: "Generated by create next app",
};

export default function RootLayout({
children,
children,
}: Readonly<{
children: React.ReactNode;
children: React.ReactNode;
}>) {
return (
<html lang="en">
<ThemeProvider config={config}>
<body>{children}</body>
</ThemeProvider>
</html>
);
return (
<html lang="en">
<ThemeProvider config={config}>
<body>{children}</body>
</ThemeProvider>
</html>
);
}
100 changes: 50 additions & 50 deletions example/src/app/page.tsx
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>
);
}
32 changes: 16 additions & 16 deletions example/src/theme-config.ts
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 {}
}
Loading

0 comments on commit 1395d2f

Please sign in to comment.