-
Notifications
You must be signed in to change notification settings - Fork 38
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: add fixes and guide for tailwind v4 #698
Changes from all commits
390d185
f1d9247
bf9f372
b992280
f81be4a
b2821b2
9f21409
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,6 @@ const tseslintConfig = tseslint.config( | |
'@typescript-eslint/no-inferrable-types': 'error', | ||
'@typescript-eslint/ban-ts-comment': 'error', | ||
'@typescript-eslint/prefer-namespace-keyword': 'error', | ||
'@typescript-eslint/no-unsafe-assignment': 'error', | ||
'@typescript-eslint/no-non-null-assertion': 'error', | ||
}, | ||
} | ||
|
@@ -49,13 +48,16 @@ const typescriptConfig = [ | |
import: _import, | ||
}, | ||
rules: { | ||
'@typescript-eslint/no-unsafe-argument': 'off', | ||
'@typescript-eslint/no-unsafe-member-access': 'off', | ||
'@typescript-eslint/no-unsafe-assignment': 'off', | ||
Comment on lines
+51
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. さすが大変になってきたので一旦offにした。このエラーは伝播するので少しだけでもcastしたらすごいことになりますね |
||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'@typescript-eslint/no-unused-vars': [ | ||
'error', | ||
{ argsIgnorePattern: '^_', ignoreRestSiblings: true }, | ||
], | ||
'@typescript-eslint/no-unnecessary-condition': 'error', | ||
'@typescript-eslint/strict-boolean-expressions': 'error', | ||
'@typescript-eslint/strict-boolean-expressions': 'off', | ||
'@typescript-eslint/consistent-type-definitions': 'off', | ||
'@typescript-eslint/no-empty-interface': 'off', | ||
'import/no-extraneous-dependencies': [ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
"main": "./src/index.cjs", | ||
"module": " ./src/index.js", | ||
"exports": { | ||
"types": "./src/index.d.ts", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for |
||
"require": "./src/index.cjs", | ||
"default": "./src/index.js" | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,10 +17,10 @@ export default function TokenV2Tailwind() { | |
<div aria-label="Categories" role="tablist"> | ||
{categories.map((category) => ( | ||
<a | ||
className={`text-text-tertiary hover:text-text-tertiary-hover active:text-text-tertiary-press text-body px-component-30 border-t-l cursor-pointer border-[0px] border-solid py-[13px] font-bold ${ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 元の実装が若干怪しかったでした |
||
className={`text-body px-component-30 border-t-l cursor-pointer border-[0px] border-solid py-[13px] font-bold ${ | ||
category === selected | ||
? 'border-selected text-text' | ||
: 'border-[transparent]' | ||
: 'border-[transparent] text-text-tertiary hover:text-text-tertiary-hover active:text-text-tertiary-press' | ||
}`} | ||
id={`category-${category}`} | ||
role="tab" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,24 @@ yarn | |
yarn add -D @charcoal-ui/tailwind-config | ||
``` | ||
|
||
## 使い方 | ||
## 使い方 tailwind v4 (WIP) | ||
|
||
Tailwind v4 の[@config](https://tailwindcss.com/docs/functions-and-directives#config-directive)経由で引き続既存の設定を利用できます。 | ||
|
||
公式の[マイグレーションガイド](https://tailwindcss.com/docs/upgrade-guide)を参考した上以下の対応を行なってください。 | ||
|
||
```diff | ||
- @import 'tailwindcss'; | ||
/* 現時点@layer 未対応 */ | ||
+ @import 'tailwindcss/theme.css'; | ||
+ @import 'tailwindcss/utilities.css'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. components を import してないのはなぜですか?( これ入れないと https://github.com/tailwindlabs/tailwindcss-typography とかを使ってるプロジェクトは壊れるので可能な限り There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. おや、なるほど。 しかし There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @yue4u これって解決しましたか? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. このMRは一時的対策で、PRで書いた手順で動くよーという意味であって完全にリスク回避するものではないです。つまり私からみて一旦これ以上できることはないです。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 了解です |
||
|
||
+ @config '@charcoal-ui/tailwind-config' /** デフォルトのconfig使う場合 */ | ||
/* また */ | ||
+ @config '../tailwind.config.ts' /** v3 configへのpath */ | ||
``` | ||
|
||
## 使い方 tailwind v2,v3 | ||
|
||
tailwind.config.js の中で `require` して使います。 | ||
|
||
|
@@ -26,7 +43,7 @@ tailwind.config.js の中で `require` して使います。 | |
const { config } = require('@charcoal-ui/tailwind-config') | ||
|
||
/** | ||
* @type {import('tailwindcss/tailwind-config').TailwindConfig} | ||
* @type {import('tailwindcss').Config} | ||
*/ | ||
module.exports = { | ||
darkMode: false, | ||
|
@@ -42,7 +59,7 @@ const { light, dark } = require('@charcoal-ui/theme') | |
const { createTailwindConfig } = require('@charcoal-ui/tailwind-config') | ||
|
||
/** | ||
* @type {import('tailwindcss/tailwind-config').TailwindConfig} | ||
* @type {import('tailwindcss').Config} | ||
*/ | ||
module.exports = { | ||
darkMode: false, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from tailwind 3.1