From 4918cf1055c428943fec011b7223f77375f228a4 Mon Sep 17 00:00:00 2001 From: Stef Williams Date: Fri, 1 Nov 2024 15:35:28 -0400 Subject: [PATCH 1/7] refactor: theme builder styles to use tailwind --- config/webpack/demo/webpack.config.dev.js | 6 +- demo/styles.scss | 25 -- demo/ts/app.tsx | 1 - demo/ts/components/theme-builder/button.tsx | 5 +- .../theme-builder/color-scale-options.tsx | 16 +- .../theme-builder/config-preview.tsx | 16 +- demo/ts/components/theme-builder/index.tsx | 28 +- demo/ts/components/theme-builder/select.tsx | 6 +- demo/ts/components/theme-builder/tailwind.css | 9 + .../theme-builder/theme-builder.scss | 241 ---------------- package.json | 5 +- pnpm-lock.yaml | 267 ++++++++---------- postcss.config.js | 6 + tailwind.config.js | 25 ++ 14 files changed, 204 insertions(+), 452 deletions(-) delete mode 100644 demo/styles.scss create mode 100644 demo/ts/components/theme-builder/tailwind.css delete mode 100644 demo/ts/components/theme-builder/theme-builder.scss create mode 100644 postcss.config.js create mode 100644 tailwind.config.js diff --git a/config/webpack/demo/webpack.config.dev.js b/config/webpack/demo/webpack.config.dev.js index 3c86de942..95fd7a9de 100644 --- a/config/webpack/demo/webpack.config.dev.js +++ b/config/webpack/demo/webpack.config.dev.js @@ -54,13 +54,9 @@ module.exports = { options: require("../../../.babelrc.js"), }, }, - { - test: /\.scss$/, - use: ["style-loader", "css-loader", "sass-loader"], - }, { test: /\.css$/, - use: ["style-loader", "css-loader"], + use: ["style-loader", "css-loader", "postcss-loader"], }, ], }, diff --git a/demo/styles.scss b/demo/styles.scss deleted file mode 100644 index 76277da81..000000000 --- a/demo/styles.scss +++ /dev/null @@ -1,25 +0,0 @@ -@use "ts/components/theme-builder/theme-builder.scss"; - -// Global resets -* { - margin: 0; - padding: 0; - box-sizing: border-box; -} - -body { - font-family: "Roboto", sans-serif; - font-size: 14px; - line-height: 1.5; - color: #333; -} - -h1, -h2, -h3, -h4, -h5, -h6 { - margin-top: 0; - margin-bottom: 0.5em; -} diff --git a/demo/ts/app.tsx b/demo/ts/app.tsx index e9c1a89bb..11e281675 100644 --- a/demo/ts/app.tsx +++ b/demo/ts/app.tsx @@ -1,6 +1,5 @@ import * as React from "react"; import * as ReactDOM from "react-dom"; -import "../styles.scss"; import AccessibilityDemo from "./components/accessibility-demo"; import AnimationDemo from "./components/animation-demo"; diff --git a/demo/ts/components/theme-builder/button.tsx b/demo/ts/components/theme-builder/button.tsx index 207b81d0f..bf35a5fd8 100644 --- a/demo/ts/components/theme-builder/button.tsx +++ b/demo/ts/components/theme-builder/button.tsx @@ -16,12 +16,15 @@ const Button = ({ disabled = false, ...props }: ButtonProps) => { + const baseClasses = + "py-2 px-5 border-0 rounded-md cursor-pointer text-sm bg-primary text-white hover:bg-secondary disabled:bg-gray-200 disabled:cursor-not-allowed"; + return (

Theme Config Preview

- + {JSON.stringify(config, null, 2)} -
+
{copyStatus && ( - {copyStatus} + {copyStatus} )}