From b33fc917cf6a2de7e40edc53ffcd237237d72573 Mon Sep 17 00:00:00 2001 From: Claas Date: Fri, 19 Apr 2024 14:48:05 +0200 Subject: [PATCH] Add more information for users --- README.md | 42 +++++++++++++++++++++++++++++++++++++----- package.json | 16 +++++++++++++++- 2 files changed, 52 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d49adb9..4736c12 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,46 @@ -# Material Theme Plugin to Tailwind CSS +# Material Theme Plugin for Tailwind CSS -Swap Tailwind CSS design system for Material design system but still take advantage of Tailwind CSS utilities and ecosystem. +Use the Material design system with Tailwind CSS. -Primarily this allows you to use [Material color roles](https://m3.material.io/styles/color/roles). +- Swap Tailwind CSS default design system for Material where possible +- The [Tailwind CSS IntelliSense](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss) extension automatically picks up the new tokens for you to use + +Primarily this allows you to use [Material color roles](https://m3.material.io/styles/color/roles) in Tailwind CSS. + +# Get started + +### Install + +``` +npm install --save-dev @claas.dev/material-tailwind +``` + +### Configure plugin + +In your Tailwind CSS configuration e.g. `tailwind.config.js` + +```js +import materialTailwind from "@claas.dev/material-tailwind"; + +/** @type {import('tailwindcss').Config} */ +export default { + content: ["./index.html", "./src/**/*.{js,jsx,ts,tsx}"], + theme: { + extend: {}, + }, + // Choose your source color to construct your theme from + plugins: [materialTailwind({ source: "#0c1445" })], +}; +``` + +For reference you can look at an [example](https://github.com/SantaClaas/material-tailwind/tree/main/example) using SolidJS. # How it works -This package provides a Tailwind CSS plugin that wraps [material-color-utilites](https://www.npmjs.com/package/@material/material-color-utilities) for colors and provides other material theme tokens collected from various sources like [materiarl.io](https://material.io) and the [Figma Material 3 Design Kit (Community)](https://www.figma.com/community/file/1035203688168086460). +This package provides a Tailwind CSS plugin that wraps [material-color-utilites](https://www.npmjs.com/package/@material/material-color-utilities) for colors and provides other material theme tokens collected from various sources like [material.io](https://material.io) and the [Figma Material 3 Design Kit (Community)](https://www.figma.com/community/file/1035203688168086460). # Roadmap - Support high and medium contrast as seen in theme.json output from Material theme builder -- Implement configuration +- Add more configuration options + - Make overwrite optional diff --git a/package.json b/package.json index f180c65..3083fb1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,17 @@ { "name": "@claas.dev/material-tailwind", + "description": "Use the Material design system with Tailwind CSS.", + "homepage": "https://github.com/santaclaas/material-tailwind", "license": "Apache-2.0", + "author": { + "name": "claas", + "email": "material-tailwind@claas.dev", + "url": "https://claas.dev" + }, + "repository": { + "type": "git", + "url": "santaclaas/material-tailwind" + }, "private": false, "version": "0.0.0", "type": "module", @@ -8,5 +19,8 @@ "dependencies": { "@material/material-color-utilities": "./@material/material-color-utilities", "tailwindcss": "^3.4.1" - } + }, + "bundledDependencies": [ + "@material/material-color-utilities" + ] } -- knotmirror 0.0.1