2.1.3 • Published 2 years ago

@leonardodipace/ui v2.1.3

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

@leonardodipace/ui

A simple Svelte component library built on top of bits-ui and TailwindCSS.

Prerequisites

You only need to configure TailwindCSS in your project and you're good to go!

Installation

To install the component library, simply install it with the following command

npm install @leonardodipace/ui

To make the library work, you also need to put the following code in your tailwind.config.js file. Please note that you can customize everything according to your needs!

/** @type {import('tailwindcss').Config} */
export default {
  content: ["./src/**/*.{html,js,svelte,ts}"],

  theme: {
    extend: {
      colors: {
        background: "#020617",
        foreground: "#f8fafc",
        foregroundMuted: "#94a3b8",

        primary: "#34d399",
        primaryForeground: "#020617",

        warning: "#fbbf24",
        warningForeground: "#020617",

        error: "#f87171",
        errorForeground: "#020617",

        panel: "#090e1f",
        panelForeground: "#f8fafc",

        overlay: "#020617",
        overlayForeground: "#f8fafc",
      },
    },
  },

  plugins: [],
};

Finally, add the following code to your app.css:

/* TailwindCSS */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Base layer */
@layer base {
  html {
    @apply bg-background;
    @apply text-foreground;
  }
}

/* Utilities layer */
@layer utilities {
  .animated {
    @apply transition-all;

    @apply before:absolute;
    @apply before:pointer-events-none;
    @apply before:transition-all;

    @apply after:absolute;
    @apply after:pointer-events-none;
    @apply after:transition-all;
  }

  .hoverable {
    @apply relative;
    @apply overflow-hidden;

    @apply after:content-[""];
    @apply after:absolute;
    @apply after:inset-0;
    @apply after:pointer-events-none;
    @apply after:bg-current;
    @apply after:opacity-0;

    @apply hover:after:opacity-5;
  }

  .clickable {
    @apply cursor-pointer;

    @apply active:scale-95;
  }
}

Usage

Simply import what you need and use it, it's as simple as that!

<script lang="ts">
  import { Button } from "@leonardodipace/ui";
</script>

<Button>Hello world!</Button>
1.2.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.8.2

2 years ago

1.6.4

2 years ago

1.8.0

2 years ago

1.4.4

2 years ago

1.4.3

2 years ago

1.4.2

2 years ago

1.0.6

2 years ago

1.4.1

2 years ago

1.0.5

2 years ago

1.4.0

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.4

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.3.9

2 years ago

1.5.6

2 years ago

1.3.8

2 years ago

1.1.0

2 years ago

1.5.5

2 years ago

1.5.4

2 years ago

1.3.6

2 years ago

1.7.1

2 years ago

1.5.3

2 years ago

1.3.5

2 years ago

1.7.0

2 years ago

1.5.2

2 years ago

1.3.4

2 years ago

1.5.1

2 years ago

1.3.3

2 years ago

1.5.0

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.3

2 years ago

2.1.0

2 years ago

1.8.5

2 years ago

1.8.4

2 years ago

1.8.3

2 years ago

0.1.0

2 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.1.2

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.3.2

2 years ago

0.2.3

2 years ago

0.0.5

2 years ago

0.3.1

2 years ago

0.2.2

2 years ago

0.0.4

2 years ago

0.2.5

2 years ago

0.0.7

2 years ago

0.3.3

2 years ago

0.2.4

2 years ago

0.0.6

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago