Git Product home page Git Product logo

puik's Introduction

Logo

Puik

The PrestaShop UI Kit

Documentation

About The Project

Puik is a component library that aims to provide a complete set of reusable components based on the PrestaShop Design System for all the PrestaShop ecosystem.

Using the VueJS components

Prerequisites

  • Node.js LTS is required.

Installation

# chose your favorite package manager
# NPM
$ npm install @prestashopcorp/puik --save

# Yarn
$ yarn add @prestashopcorp/puik

# pnpm
$ pnpm install @prestashopcorp/puik

(back to top)

Usage

Auto import (recommended)

First you need to install unplugin-vue-components & unplugin-auto-import

$ npm install -D unplugin-vue-components unplugin-auto-import

# Yarn
$ yarn add unplugin-vue-components unplugin-auto-import -D

# pnpm
$ pnpm install unplugin-vue-components unplugin-auto-import -D

Then add the code below in your vite.config file

import { defineConfig } from 'vite'
import Components from 'unplugin-vue-components/vite'
import AutoImport from 'unplugin-auto-import/vite'
import { PuikResolver } from '@prestashopcorp/puik'

export default defineConfig({
  plugins: [
    // ...
    Components({
      resolvers: [PuikResolver()],
    }),
    AutoImport({
      resolvers: [PuikResolver()],
    }),
  ],
})

On demand import

Import the vue component and the component css directly into your vue file

<script setup>
import '@prestashopcorp/puik/es/components/button/style/css'
import { PuikButton } from '@prestashopcorp/puik'
</script>

<template>
  <puik-button>Example button</puik-button>
</template>

(back to top)

Full import

If you don't care about bundle size you can full import the library by following these instructions

Import the vue library and the css directly into your main.js / main.ts

import { createApp } from 'vue'
import Puik from '@prestashopcorp/puik'
import '@prestashopcorp/puik/dist/index.css'
import App from './App.vue'

const app = createApp(App)

app.use(Puik)
app.mount('#app')

(back to top)

Dark Mode

We are using the Tailwind Dark Mode.

To use it you just have to write the css dark rules with dark:<oneRule> in your css. (I recommand to put your light and dark styles on two lines for greater readability)

Exemple
Here we are saying the button background will be blue in light mode and green in dark mode

.my-button {
  @apply bg-blue;
  @apply dark:bg-green;
}

Using the CSS components

If you don't use VueJS for your application, you can use the CSS only version of our components. It includes all the styles used in the VueJs component library.

Usage

  1. Include the CSS in your HTML by using the CDN
<link
  rel="stylesheet"
  href="https://unpkg.com/@prestashopcorp/puik/dist/index.css"
/>
  1. Add the classes in your HTML
<button class="puik-button">Example button</button>

(back to top)

Contributing

Please make sure to read the Contributing Guide before making a pull request

(back to top)

puik's People

Contributors

kelhel avatar aamorim27 avatar mattgoud avatar guillaumeguerin1 avatar jmcollin avatar prxmat avatar mikelebeau avatar renovate[bot] avatar mrbaiame avatar ga-devfront avatar julienr114 avatar ady642 avatar fox-john avatar francoisqtr avatar claralpresta avatar khanhmas avatar cnavarro-prestashop avatar antoinemetifeu avatar elisegriset92 avatar damianbaker avatar ancardinale avatar

Stargazers

Isaac avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.