mirror of
https://github.com/nostalgic-css/NES.css.git
synced 2025-08-22 13:52:48 +02:00
scaffolding
This commit is contained in:
18
.storybook/main.ts
Normal file
18
.storybook/main.ts
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import { StorybookConfig } from '@storybook/html-vite'
|
||||||
|
|
||||||
|
const config: StorybookConfig = {
|
||||||
|
stories: ["../src/**/*.stories.mdx"],
|
||||||
|
addons: [
|
||||||
|
"@storybook/addon-links",
|
||||||
|
"@storybook/addon-essentials",
|
||||||
|
"@storybook/addon-interactions",
|
||||||
|
],
|
||||||
|
framework: {
|
||||||
|
name: "@storybook/html-vite",
|
||||||
|
options: {},
|
||||||
|
},
|
||||||
|
docs: {
|
||||||
|
autodocs: "tag",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
export default config;
|
16
.storybook/preview.ts
Normal file
16
.storybook/preview.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import { Preview } from '@storybook/html'
|
||||||
|
import '../src/core'
|
||||||
|
|
||||||
|
const preview: Preview = {
|
||||||
|
parameters: {
|
||||||
|
actions: { argTypesRegex: "^on[A-Z].*" },
|
||||||
|
controls: {
|
||||||
|
matchers: {
|
||||||
|
color: /(background|color)$/i,
|
||||||
|
date: /Date$/,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default preview;
|
19696
package-lock.json
generated
Normal file
19696
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
17
package.json
17
package.json
@@ -2,6 +2,8 @@
|
|||||||
"name": "nes.css",
|
"name": "nes.css",
|
||||||
"description": "NES.css is NES-style CSS Framework.",
|
"description": "NES.css is NES-style CSS Framework.",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"storybook": "storybook dev -p 6006",
|
||||||
|
"build-storybook": "storybook build"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -14,5 +16,18 @@
|
|||||||
"framework"
|
"framework"
|
||||||
],
|
],
|
||||||
"author": "BcRikko (https://github.com/Bcrikko)",
|
"author": "BcRikko (https://github.com/Bcrikko)",
|
||||||
"license": "MIT"
|
"license": "MIT",
|
||||||
|
"devDependencies": {
|
||||||
|
"@storybook/addon-essentials": "^7.0.0",
|
||||||
|
"@storybook/addon-interactions": "^7.0.0",
|
||||||
|
"@storybook/addon-links": "^7.0.0",
|
||||||
|
"@storybook/blocks": "^7.0.0",
|
||||||
|
"@storybook/html": "^7.0.0",
|
||||||
|
"@storybook/html-vite": "^7.0.0",
|
||||||
|
"@storybook/testing-library": "^0.0.14-next.2",
|
||||||
|
"react": "^18.2.0",
|
||||||
|
"react-dom": "^18.2.0",
|
||||||
|
"storybook": "^7.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {}
|
||||||
}
|
}
|
||||||
|
14
src/core/foundation.css
vendored
Normal file
14
src/core/foundation.css
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
*,
|
||||||
|
*::before,
|
||||||
|
*::after {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
input,
|
||||||
|
button,
|
||||||
|
select,
|
||||||
|
textarea {
|
||||||
|
font-family: inherit;
|
||||||
|
font-size: inherit;
|
||||||
|
line-height: inherit;
|
||||||
|
}
|
1
src/core/index.ts
Normal file
1
src/core/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
import './foundation.css'
|
1
src/core/properties.css
Normal file
1
src/core/properties.css
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/* keep */
|
48
src/elements/button/button.css
Normal file
48
src/elements/button/button.css
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
@property --nes-btn-border-width {
|
||||||
|
syntax: '<line-width>';
|
||||||
|
inherits: false;
|
||||||
|
initial-value: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@property --nes-btn-border-color {
|
||||||
|
syntax: '<color>';
|
||||||
|
inherits: false;
|
||||||
|
initial-value: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
@property --nes-btn-border-inset-color {
|
||||||
|
syntax: '<color>';
|
||||||
|
inherits: false;
|
||||||
|
initial-value: gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CSS Variables
|
||||||
|
*/
|
||||||
|
.nes-btn {
|
||||||
|
--nes-btn-border-width: 4px;
|
||||||
|
--nes-btn-border-color: black;
|
||||||
|
--nes-btn-border-inset-color: gray;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Basic Style
|
||||||
|
*/
|
||||||
|
.nes-btn {
|
||||||
|
border: solid var(--nes-btn-border-width) var(--nes-btn-border-color);
|
||||||
|
box-shadow:
|
||||||
|
inset 0 calc(var(--nes-btn-border-width) * -1) var(--nes-btn-border-inset-color),
|
||||||
|
inset calc(var(--nes-btn-border-width) * -1) 0 var(--nes-btn-border-inset-color);
|
||||||
|
|
||||||
|
--nes-n: var(--nes-btn-border-width);
|
||||||
|
--nes-m: calc(100% - var(--nes-btn-border-width));
|
||||||
|
clip-path: polygon(
|
||||||
|
0 var(--nes-n), var(--nes-n) var(--nes-n), var(--nes-n) 0,
|
||||||
|
var(--nes-m) 0, var(--nes-m) var(--nes-n), 100% var(--nes-n),
|
||||||
|
100% var(--nes-m), var(--nes-m) var(--nes-m), var(--nes-m) 100%,
|
||||||
|
var(--nes-n) 100%, var(--nes-n) var(--nes-m), 0 var(--nes-m)
|
||||||
|
);
|
||||||
|
|
||||||
|
padding: 0.5em 1em;
|
||||||
|
}
|
55
src/elements/button/button.stories.mdx
Normal file
55
src/elements/button/button.stories.mdx
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
import { Canvas, Meta, Story } from "@storybook/addon-docs";
|
||||||
|
import "./button.css";
|
||||||
|
|
||||||
|
<Meta title="MDX/Elements/Button" />
|
||||||
|
|
||||||
|
# Elements/Button
|
||||||
|
|
||||||
|
This is button.
|
||||||
|
|
||||||
|
<Canvas>
|
||||||
|
<Story name="Button">
|
||||||
|
{() => `
|
||||||
|
<button class="nes-btn">
|
||||||
|
Click me!
|
||||||
|
</button>
|
||||||
|
`}
|
||||||
|
</Story>
|
||||||
|
</Canvas>
|
||||||
|
|
||||||
|
## CSS Variables
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>@property</th>
|
||||||
|
<th>syntax</th>
|
||||||
|
<th>inherits</th>
|
||||||
|
<th>initial-value</th>
|
||||||
|
<th>comments</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>`--nes-btn-border-width`</td>
|
||||||
|
<td>`<line-width>`</td>
|
||||||
|
<td>`false`</td>
|
||||||
|
<td>`4px`</td>
|
||||||
|
<td>...</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>`--nes-btn-border-color`</td>
|
||||||
|
<td>`<color>`</td>
|
||||||
|
<td>`false`</td>
|
||||||
|
<td>`black`</td>
|
||||||
|
<td>...</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>`--nes-btn-border-inset-color`</td>
|
||||||
|
<td>`<color>`</td>
|
||||||
|
<td>`false`</td>
|
||||||
|
<td>`gray`</td>
|
||||||
|
<td>...</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
Reference in New Issue
Block a user