1.1.38 • Published 8 months ago

component-nest v1.1.38

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Installation

Prerequisite

Install

  • Install the component-nest package
npm install component-nest
  • Add transpilePackages for component-nest to next.config.mjs
const nextConfig = {
  transpilePackages: ["component-nest"], // add this line
};
  • update tailwind.config.ts
import type { Config } from "tailwindcss";
import { colors } from "component-nest/colors"; // import component nest colors

colors["dark-font-color-1"] = "#80ed99"; // Override any of the colors to match your desired theme

const config: Config = {
  darkMode: "selector", // turn on dark mode selector
  content: [
    "./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
    "./src/components/**/*.{js,ts,jsx,tsx,mdx}",
    "./src/app/**/*.{js,ts,jsx,tsx,mdx}",
    "node_modules/component-nest/components/**/*.{js,ts,jsx,tsx,mdx}", // add component nest to tailwind conent
  ],
  theme: {
    extend: {
      backgroundImage: {
        "gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
        "gradient-conic":
          "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
      },
    },
    colors: {
      ...colors, // extend colors
    },
  },
  plugins: [],
};
export default config;

Usage

Components

  • Import tsx components and use them in your project
// Page.jsx
import Button from "component-nest/components/client/buttons/Button";

export function Page() {
  return (
    <main>
      <Button>Click me</Button>
    </main>
  );
}

Overriding CSS Classes

  • Parent Element Class Override
    • This project uses twmerge and supports a className property that will override any existing tailwind css classes on the parent component
    className="bg-blue-100"
  • Nested Element CSS Override
    • Use tailwind abritrary directives
    className="[&_#top-navbar-links]:bg-blue-100"
1.1.38

8 months ago

1.1.37

10 months ago

1.1.36

10 months ago

1.1.29

1 year ago

1.1.28

1 year ago

1.1.30

1 year ago

1.1.34

1 year ago

1.1.12

1 year ago

1.1.33

1 year ago

1.1.11

1 year ago

1.1.32

1 year ago

1.1.31

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.35

1 year ago

1.1.13

1 year ago

1.1.19

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

1.1.23

1 year ago

1.1.22

1 year ago

1.1.21

1 year ago

1.1.20

1 year ago

1.1.27

1 year ago

1.1.26

1 year ago

1.1.25

1 year ago

1.1.24

1 year ago

1.1.1

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago