From 7f7aa5607186545e702a88a2ef511e915aa267bd Mon Sep 17 00:00:00 2001 From: maiieul Date: Thu, 19 Jun 2025 20:01:56 +0200 Subject: [PATCH 01/42] chore: migration script --- apps/component-tests/postcss.config.cjs | 11 - apps/component-tests/postcss.config.js | 5 + apps/component-tests/src/global.css | 153 ++-- apps/website/postcss.config.cjs | 11 - apps/website/postcss.config.js | 5 + .../src/components/animations/caveats.tsx | 2 +- .../copy-css-config/copy-css-config.tsx | 4 +- .../components/feature-list/feature-list.tsx | 10 +- apps/website/src/components/header/header.tsx | 14 +- .../src/components/highlight/highlight.tsx | 6 +- .../src/components/info-popup/info-popup.tsx | 4 +- .../install-snippet/install-snippet.tsx | 2 +- .../make-it-yours/make-it-yours.tsx | 23 +- .../src/components/mdx-components/index.tsx | 12 +- apps/website/src/components/search/search.tsx | 4 +- .../src/components/showcase/showcase.tsx | 8 +- apps/website/src/global.css | 153 ++-- .../install/examples/accordion-qwik-city.tsx | 8 +- .../routes/docs/styled/accordion/index.mdx | 2 +- .../src/routes/docs/styled/badge/index.mdx | 2 +- .../src/routes/docs/styled/button/index.mdx | 2 +- .../docs/styled/carousel/examples/stepper.tsx | 4 +- .../src/routes/docs/styled/carousel/index.mdx | 4 +- .../src/routes/docs/styled/combobox/index.mdx | 4 +- .../src/routes/docs/styled/input/index.mdx | 2 +- .../docs/styled/modal/examples/hero.tsx | 2 +- .../src/routes/docs/styled/modal/index.mdx | 16 +- .../docs/styled/popover/examples/hero.tsx | 4 +- .../src/routes/docs/styled/popover/index.mdx | 4 +- .../src/routes/docs/styled/select/index.mdx | 8 +- .../src/routes/docs/styled/tabs/index.mdx | 4 +- .../src/routes/docs/styled/textarea/index.mdx | 2 +- .../src/routes/docs/styled/toggle/index.mdx | 2 +- .../src/routes/docs/styled/tooltip/index.mdx | 2 +- apps/website/src/routes/index@landing.tsx | 2 +- apps/website/src/routes/layout.tsx | 4 +- apps/website/tsconfig.app.json | 1 - package.json | 3 +- .../src/components/accordion/accordion.tsx | 6 +- .../kit-styled/src/components/badge/badge.tsx | 2 +- .../src/components/button/button.tsx | 2 +- .../src/components/carousel/carousel.tsx | 12 +- .../src/components/combobox/combobox.tsx | 4 +- .../src/components/dropdown/dropdown.tsx | 10 +- .../kit-styled/src/components/input/input.tsx | 2 +- .../kit-styled/src/components/modal/modal.tsx | 16 +- .../src/components/popover/popover.tsx | 4 +- .../src/components/select/select.tsx | 8 +- .../kit-styled/src/components/tabs/tabs.tsx | 6 +- .../src/components/textarea/textarea.tsx | 2 +- .../src/components/toggle/toggle.tsx | 2 +- .../src/components/tooltip/tooltip.tsx | 2 +- packages/kit-styled/src/templates/global.css | 155 ++-- pnpm-lock.yaml | 748 ++++++++++-------- 54 files changed, 792 insertions(+), 698 deletions(-) delete mode 100644 apps/component-tests/postcss.config.cjs create mode 100644 apps/component-tests/postcss.config.js delete mode 100644 apps/website/postcss.config.cjs create mode 100644 apps/website/postcss.config.js diff --git a/apps/component-tests/postcss.config.cjs b/apps/component-tests/postcss.config.cjs deleted file mode 100644 index acdecac1e..000000000 --- a/apps/component-tests/postcss.config.cjs +++ /dev/null @@ -1,11 +0,0 @@ -const path = require('path'); - -module.exports = { - plugins: { - 'tailwindcss/nesting': 'postcss-nested', - tailwindcss: { - config: path.join(__dirname, 'tailwind.config.cjs'), - }, - autoprefixer: {}, - }, -}; diff --git a/apps/component-tests/postcss.config.js b/apps/component-tests/postcss.config.js new file mode 100644 index 000000000..c2ddf7482 --- /dev/null +++ b/apps/component-tests/postcss.config.js @@ -0,0 +1,5 @@ +export default { + plugins: { + "@tailwindcss/postcss": {}, + }, +}; diff --git a/apps/component-tests/src/global.css b/apps/component-tests/src/global.css index 1775a6b48..dcd114012 100644 --- a/apps/component-tests/src/global.css +++ b/apps/component-tests/src/global.css @@ -1,6 +1,41 @@ -@tailwind components; -@tailwind base; -@tailwind utilities; +@import 'tailwindcss'; + +@config '../tailwind.config.cjs'; + +/* + The default border color has changed to `currentcolor` in Tailwind CSS v4, + so we've added these compatibility styles to make sure everything still + looks the same as it did with Tailwind CSS v3. + + If we ever want to remove these styles, we need to add an explicit border + color utility to any element that depends on these defaults. +*/ +@layer base { + *, + ::after, + ::before, + ::backdrop, + ::file-selector-button { + border-color: var(--color-gray-200, currentcolor); + } +} + +@utility accordion-animation-1 { + &[data-open] { + animation: 500ms cubic-bezier(0.87, 0, 0.13, 1) 0s 1 normal forwards + accordion-open; + } + + &[data-closed] { + animation: 500ms cubic-bezier(0.87, 0, 0.13, 1) 0s 1 normal forwards + accordion-close; + } +} + +/* Not used yet - could be used for the colored text on the landing page when the make-it-yours color is too bright in light mode or too dim in dark mode */ +@utility text-outlined { + @apply [text-shadow:-1px_0_#777,0_1px_#777,1px_0_#777,0_-1px_#777] dark:[text-shadow:-1px_0_#ccc,0_1px_#ccc,1px_0_#ccc,0_-1px_#ccc]; +} @layer base { :root { @@ -1313,72 +1348,58 @@ } } -:root { - /* primary colors - try using primary and secondary instead */ - --qwikui-purple-50: #f9f5ff; - --qwikui-purple-100: #f2e8ff; - --qwikui-purple-200: #e7d6fe; - --qwikui-purple-300: #d4b5fd; - --qwikui-purple-400: #b37bfa; - --qwikui-purple-500: #9f57f5; - --qwikui-purple-600: #8835e8; - --qwikui-purple-700: #7424cc; - --qwikui-purple-800: #6323a6; - --qwikui-purple-900: #521d86; - --qwikui-purple-950: #360863; - - --qwikui-blue-50: #effaff; - --qwikui-blue-100: #def3ff; - --qwikui-blue-200: #b6eaff; - --qwikui-blue-300: #76dbff; - --qwikui-blue-400: #2dcaff; - --qwikui-blue-500: #02b9fc; - --qwikui-blue-600: #0090d2; - --qwikui-blue-700: #0073aa; - --qwikui-blue-800: #00618c; - --qwikui-blue-900: #075073; - --qwikui-blue-950: #04334d; - - /* neutrals - for internal use */ - --qwikui-slate-50: #f8fafc; - --qwikui-slate-100: #f1f5f9; - --qwikui-slate-200: #e2e8f0; - --qwikui-slate-300: #cbd5e1; - --qwikui-slate-400: #94a3b8; - --qwikui-slate-500: #64748b; - --qwikui-slate-600: #475569; - --qwikui-slate-700: #334155; - --qwikui-slate-800: #1e293b; - --qwikui-slate-900: #0f172a; - --qwikui-slate-950: #020617; -} - -html { - height: 100%; - min-height: 100%; - scroll-behavior: smooth; -} - -body { - min-height: 100%; -} - -/* Utilities layer for animations. The current arbitrary & docs tailwind animation guidelines are not maintainable long term. - It would make more sense to supply the user with the animation declaration in the docs. -*/ @layer utilities { - .accordion-animation-1[data-open] { - animation: 500ms cubic-bezier(0.87, 0, 0.13, 1) 0s 1 normal forwards accordion-open; + :root { + /* primary colors - try using primary and secondary instead */ + --qwikui-purple-50: #f9f5ff; + --qwikui-purple-100: #f2e8ff; + --qwikui-purple-200: #e7d6fe; + --qwikui-purple-300: #d4b5fd; + --qwikui-purple-400: #b37bfa; + --qwikui-purple-500: #9f57f5; + --qwikui-purple-600: #8835e8; + --qwikui-purple-700: #7424cc; + --qwikui-purple-800: #6323a6; + --qwikui-purple-900: #521d86; + --qwikui-purple-950: #360863; + + --qwikui-blue-50: #effaff; + --qwikui-blue-100: #def3ff; + --qwikui-blue-200: #b6eaff; + --qwikui-blue-300: #76dbff; + --qwikui-blue-400: #2dcaff; + --qwikui-blue-500: #02b9fc; + --qwikui-blue-600: #0090d2; + --qwikui-blue-700: #0073aa; + --qwikui-blue-800: #00618c; + --qwikui-blue-900: #075073; + --qwikui-blue-950: #04334d; + + /* neutrals - for internal use */ + --qwikui-slate-50: #f8fafc; + --qwikui-slate-100: #f1f5f9; + --qwikui-slate-200: #e2e8f0; + --qwikui-slate-300: #cbd5e1; + --qwikui-slate-400: #94a3b8; + --qwikui-slate-500: #64748b; + --qwikui-slate-600: #475569; + --qwikui-slate-700: #334155; + --qwikui-slate-800: #1e293b; + --qwikui-slate-900: #0f172a; + --qwikui-slate-950: #020617; + } + + html { + height: 100%; + min-height: 100%; + scroll-behavior: smooth; } - .accordion-animation-1[data-closed] { - animation: 500ms cubic-bezier(0.87, 0, 0.13, 1) 0s 1 normal forwards accordion-close; + body { + min-height: 100%; } -} -/* Not used yet - could be used for the colored text on the landing page when the make-it-yours color is too bright in light mode or too dim in dark mode */ -@layer components { - .text-outlined { - @apply [text-shadow:-1px_0_#777,_0_1px_#777,_1px_0_#777,_0_-1px_#777] dark:[text-shadow:-1px_0_#ccc,_0_1px_#ccc,_1px_0_#ccc,_0_-1px_#ccc]; - } + /* Utilities layer for animations. The current arbitrary & docs tailwind animation guidelines are not maintainable long term. + It would make more sense to supply the user with the animation declaration in the docs. +*/ } diff --git a/apps/website/postcss.config.cjs b/apps/website/postcss.config.cjs deleted file mode 100644 index acdecac1e..000000000 --- a/apps/website/postcss.config.cjs +++ /dev/null @@ -1,11 +0,0 @@ -const path = require('path'); - -module.exports = { - plugins: { - 'tailwindcss/nesting': 'postcss-nested', - tailwindcss: { - config: path.join(__dirname, 'tailwind.config.cjs'), - }, - autoprefixer: {}, - }, -}; diff --git a/apps/website/postcss.config.js b/apps/website/postcss.config.js new file mode 100644 index 000000000..c2ddf7482 --- /dev/null +++ b/apps/website/postcss.config.js @@ -0,0 +1,5 @@ +export default { + plugins: { + "@tailwindcss/postcss": {}, + }, +}; diff --git a/apps/website/src/components/animations/caveats.tsx b/apps/website/src/components/animations/caveats.tsx index e58c54c42..c9f0dfa2e 100644 --- a/apps/website/src/components/animations/caveats.tsx +++ b/apps/website/src/components/animations/caveats.tsx @@ -6,7 +6,7 @@ export const TopLayerAnimationsCaveats = component$(() => { Important Caveats for Animating Discrete Properties -