BismillahCSS Installation Guide
Welcome to BismillahCSS! This guide will help you install and set up BismillahCSS for your project. Whether you're using it via CDN, NPM, or custom builds, weβve got you covered.
π 1. Installation Methods
πΉ A. Using CDN (Quick Setup)
If you want a simple way to use BismillahCSS without installing anything, you can link it using a CDN. Just add the following <link> tag inside your HTML <head>:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My BismillahCSS Project</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bismillahcss@latest/dist/bismillah.min.css">
</head>
<body>
<h1 class="bismillah-text-3xl bismillah-text-blue-500">Hello, BismillahCSS!</h1>
</body>
</html>β Pros: Fast, No installation required
β Cons: Less customization
πΉ B. Using NPM (Recommended for Developers)
For better control and customization, install BismillahCSS via NPM/Yarn.
Step 1: Initialize Your Project (if not already done)
Run the following command to create a package.json file if you donβt have one:
npm init -yStep 2: Install BismillahCSS
Now, install BismillahCSS:
npm install bismillahcssStep 3: Import BismillahCSS in Your CSS File
Create a styles.css file and import BismillahCSS:
@import "bismillahcss/dist/bismillah.css";Or import it directly in your JavaScript file:
import "bismillahcss/dist/bismillah.css";Step 4: Use It in Your HTML
Now, use the utility classes in your HTML file:
<button class="bismillah-bg-blue-600 bismillah-text-white bismillah-py-2 bismillah-px-4 bismillah-rounded">
Click Me
</button>β Pros: Customizable, easy to update
β Cons: Requires Node.js
πΉ C. Using BismillahCSS with PostCSS (Advanced Customization)
If you want full control over BismillahCSS, you can integrate it with PostCSS.
Step 1: Install Required Packages
Run the following command:
npm install postcss postcss-cli autoprefixer bismillahcssStep 2: Create a postcss.config.js File
Inside your project root, create a postcss.config.js file:
module.exports = {
plugins: [
require("bismillahcss"),
require("autoprefixer")
]
};Step 3: Build Your CSS
Run the following command to compile your CSS:
npx postcss styles.css -o output.cssNow, link output.css in your HTML file.
β Pros: Best for large projects
β Cons: Requires extra configuration
π 2. Customization (Config File)
πΉ A. Create a Config File
Run the following command:
npx bismillahcss initThis will generate a bismillah.config.js file like this:
module.exports = {
theme: {
colors: {
primary: "#4F46E5",
secondary: "#10B981",
danger: "#EF4444"
},
extend: {
spacing: {
'72': '18rem',
'84': '21rem',
'96': '24rem'
}
}
},
variants: {
extend: {
backgroundColor: ["hover", "focus"],
textColor: ["hover", "focus"]
}
},
plugins: []
};Modify this file to add custom themes, colors, and utilities.
π 3. Using BismillahCSS in Different Environments
BismillahCSS works everywhere, including:
πΉ A. Using with React.js
In a React.js project, install BismillahCSS using NPM:
npm install bismillahcssThen, import it in index.js or App.js:
import "bismillahcss/dist/bismillah.css";Now, use the classes in your JSX:
<button className="bismillah-bg-blue-500 bismillah-text-white bismillah-px-4 bismillah-py-2">
React Button
</button>πΉ B. Using with Next.js
For a Next.js project, install BismillahCSS:
npm install bismillahcssImport it in _app.js:
import "bismillahcss/dist/bismillah.css";Now, use the classes inside Next.js components.
πΉ C. Using with Vue.js
For a Vue.js project, install BismillahCSS:
npm install bismillahcssImport it in main.js:
import "bismillahcss/dist/bismillah.css";Use the classes inside Vue templates:
<template>
<button class="bismillah-bg-green-500 bismillah-text-white bismillah-py-2 bismillah-px-4">
Vue Button
</button>
</template>π 4. BismillahCSS CDN vs. NPM vs. PostCSS (Comparison)
| Method | Pros | Cons |
|---|---|---|
| CDN | Fast, No setup required | No customization |
| NPM | Customizable, Best for large projects | Requires Node.js |
| PostCSS | Full control, Best for production | Requires extra setup |
π 5. FAQs (Frequently Asked Questions)
β 1. How do I update BismillahCSS?
Run the following command to update:
npm update bismillahcssβ 2. Does BismillahCSS support dark mode?
Yes! Use bismillah-dark mode classes.
Example:
<div class="bismillah-dark bismillah-bg-gray-900 bismillah-text-white">
Dark Mode Example
</div>β 3. How do I add custom colors?
Modify bismillah.config.js like this:
module.exports = {
theme: {
extend: {
colors: {
mycustomcolor: "#FF5733"
}
}
}
};Now, use it:
<p class="bismillah-text-mycustomcolor">This is a custom color!</p>β 4. Can I use BismillahCSS with Bootstrap or Tailwind?
Yes, but itβs recommended to use only one framework to avoid conflicts.
π 6. Conclusion
Now you know how to install, customize, and use BismillahCSS! π
- πΉ Quick Setup: Use the CDN
- πΉ Recommended: Use NPM for customization
- πΉ Advanced: Use PostCSS for full control
