Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Design tokens / themes implementation #177

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
tailwind.config.cjs
tailwind.config.cjs
.eslintrc.cjs
rollup.config.mjs
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Semantic Release CI

on:
push:
branches: [main]
branches: [main, beta]

env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
Expand Down
47 changes: 31 additions & 16 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
{
"branches": ["main"],
"debug": true,
"ci": true,
"dryRun": false,
"plugins":
[
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/npm", { "npmPublish": true, "tarballDir": "dist" }],
"@semantic-release/github",
[
"@semantic-release/git",
"branches": [
"main",
{
"assets": ["package.json", "package-lock.json", "CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version} [skip ci]",
},
],
"name": "beta",
"prerelease": true
}
],
"debug": true,
"ci": true,
"dryRun": false,
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/npm",
{
"npmPublish": true,
"tarballDir": "dist"
}
],
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": [
"package.json",
"package-lock.json",
"CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version} [skip ci]"
}
]
]
}
1 change: 1 addition & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const config: StorybookConfig = {
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/addon-themes",
],

framework: {
Expand Down
14 changes: 11 additions & 3 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
import { withThemeByDataAttribute } from "@storybook/addon-themes";
import type { Preview } from "@storybook/react";
import "tailwindcss/tailwind.css";
import "../src/styles/index.css";

const preview: Preview = {
decorators: [
withThemeByDataAttribute({
themes: {
light: "light",
dark: "dark",
},
defaultTheme: "light",
}),
],
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
layout: "centered", // "centered" | "fullscreen"
backgrounds: {
default: "white",
values: [
{ name: "white", value: "#FFFFFF" },
{ name: "light", value: "#FAFAFC" },
{ name: "dark", value: "#212121" },
],
Expand All @@ -27,8 +36,7 @@ const preview: Preview = {
showPanel: true,
},
},

tags: ["autodocs"]
tags: ["autodocs"],
};

export default preview;
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"prettier.configPath": ".prettierrc.cjs"
"prettier.configPath": ".prettierrc.cjs",
"css.customData": [".vscode/tailwind.json"],
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
}
55 changes: 55 additions & 0 deletions .vscode/tailwind.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"version": 1.1,
"atDirectives": [
{
"name": "@tailwind",
"description": "Use the `@tailwind` directive to insert Tailwind's `base`, `components`, `utilities` and `screens` styles into your CSS.",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#tailwind"
}
]
},
{
"name": "@apply",
"description": "Use the `@apply` directive to inline any existing utility classes into your own custom CSS. This is useful when you find a common utility pattern in your HTML that you’d like to extract to a new component.",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#apply"
}
]
},
{
"name": "@responsive",
"description": "You can generate responsive variants of your own classes by wrapping their definitions in the `@responsive` directive:\n```css\n@responsive {\n .alert {\n background-color: #E53E3E;\n }\n}\n```\n",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#responsive"
}
]
},
{
"name": "@screen",
"description": "The `@screen` directive allows you to create media queries that reference your breakpoints by **name** instead of duplicating their values in your own CSS:\n```css\n@screen sm {\n /* ... */\n}\n```\n…gets transformed into this:\n```css\n@media (min-width: 640px) {\n /* ... */\n}\n```\n",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#screen"
}
]
},
{
"name": "@variants",
"description": "Generate `hover`, `focus`, `active` and other **variants** of your own utilities by wrapping their definitions in the `@variants` directive:\n```css\n@variants hover, focus {\n .btn-brand {\n background-color: #3182CE;\n }\n}\n```\n",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#variants"
}
]
}
]
}
Loading
Loading