0.0.4 โ€ข Published 4 years ago

@backpackr/style-pack v0.0.4

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

logo

npm license

!NOTICE!

This project is still not done yet! We will make this library by half of this year and release v1.0.0 soon. Please wait until that time!

style-pack

๐ŸบBasic CSS library pack

๐Ÿ’พ Install

NPM

  1. Install style-pack with npm
npm install --save @backpackr/style-pack
  1. Import at your project root JS file
// for ES6
import "@backpackr/style-pack";
// for common JS
require("@backpackr/style-pack");

Script

Using jsDelivr for CDN

<script src="https://cdn.jsdelivr.net/gh/backpackr/style-pack/app.js"></script>

If you want specific version, choose one in here

๐Ÿงฐ Usage

In this part, i will use React.js for example.

By class selector

You can use class selector to set styles like this.

import "@backpackr/style-pack";

export const Button = () => {
    return <button className="button__red">This is red button!</button>;
};

This must be just simplest way to use it.

By CSS module

You can use css module to set styles like this.

import styles from "@backpackr/style-pack/modules/styles.module.css";

export const Button = () => {
    return <button className={styles.button__red}>This is red button!</button>;
};

If you use css module, it will be easy to see what kind of styles you can use. Just console.log() it.

import styles from "@backpackr/style-pack/modules/styles.module.css";

console.log(styles);

๐ŸŒ Local environment

You can set and test this library in the local environment

  1. Clone style-pack
git clone https://github.com/backpackr/style-pack.git
  1. Build it
cd style-pack
npm run build
  1. Move it to your project and npm install by path
cd your/project
npm install ../style-pack
  1. Import at your project root JS file
// for ES6
import "@backpackr/style-pack";
// for common JS
require("@backpackr/style-pack");
  1. If your project has hot-reloading, there're two choice by usage.

Class selector

cd style-pack
npm run webpack:class

CSS module

cd style-pack
npm run webpack:module

It will make your project to show you changes immediately

๐Ÿ”จ Feature

DEMO page

  • container
  • color
  • align
  • grid
  • flex_grid
  • radius

๐Ÿ“œ License

MIT

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago