fluvia
v2.0.7
Published
Framework CSS + JS utilities
Readme
Table of Contents
- Installation
- Background Colors
- Borders
- Container and Grids
- Flexbox Utilities
- Spacing Utilities
- Typography
- Display & Position
- Shadows
- Discord Module
Installation
Via CDN
Include the stylesheet in the <head> of your HTML document:
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/fluvia@latest/dist/fluvia.min.css'>
<script src="https://cdn.jsdelivr.net/npm/fluvia@latest/dist/fluvia.min.js"></script>Via NPM
Install the package into your project using the following command:
-> npm install fluvia
Background Colors
Use the .bg-* classes to apply background colors to any element.
| Color Category | Available Classes |
| :--- | :--- |
| Red | .bg-red, .bg-dark-red |
| Blue | .bg-blue, .bg-dark-blue, .bg-light-blue |
| Green | .bg-lime-green, .bg-green, .bg-dark-green |
| Yellow | .bg-yellow |
| Orange | .bg-orange, .bg-dark-orange |
| Purple | .bg-light-purple, .bg-purple, .bg-dark-purple |
| Pink | .bg-light-pink, .bg-pink, .bg-dark-pink |
| Grey | .bg-light-grey, .bg-grey, .bg-dark-grey |
| Monochrome | .bg-black, .bg-white |
Borders
Border Styles & Widths
| Property | Available Classes |
| :--- | :--- |
| Styles | .b-solid, .b-dashed, .b-dotted |
| Widths | .b-1 (1px), .b-2 (2px), .b-3 (3px) |
Container and Grids
Grid Utilities
| Layout Type | Available Classes |
| :--- | :--- |
| Grid Base | .grid (display: grid with 1rem gap) |
| 2 Columns | .grid-2 |
| 3 Columns | .grid-3 |
| 4 Columns | .grid-4 |
Flexbox Utilities
| Property | Available Classes |
| :--- | :--- |
| Display | .fx (flex) |
| Direction | .fx-c (column) |
| Justify | .fx-jc-c (center), .fx-jc-sb (space-between) |
| Align | .fx-ai-c (center) |
Spacing Utilities
Margin & Padding Scale
| Scale | Value | | :--- | :--- | | 0 | 0px | | 1 | 4px | | 2 | 8px | | 3 | 16px | | 4 | 32px |
Typography
Font Sizes & Weights
| Property | Available Classes |
| :--- | :--- |
| Sizes | .txt-xs, .txt-sm, .txt-md, .txt-lg, .txt-xl, .txt-xxl |
| Weights | .txt-light (300), .txt-normal (400), .txt-bold (700) |
Alignment & Transform
| Property | Available Classes |
| :--- | :--- |
| Alignment | .txt-left, .txt-center, .txt-right |
| Transform | .txt-uppercase, .txt-lowercase, .txt-capitalize |
Display & Position
| Property | Available Classes |
| :--- | :--- |
| Display | .d-block, .d-inline, .d-inline-block, .d-none |
| Position | .pos-rel, .pos-abs, .pos-fixed |
| Overflow | .overflow-hidden, .overflow-scroll |
| Z-Index | .z-0, .z-10, .z-20 |
Shadows
| Shadow Size | Available Classes |
| :--- | :--- |
| Small | .shadow-sm |
| Medium | .shadow-md |
| Large | .shadow-lg |
JavaScript Utilities
Fluvia also provides JavaScript modules to handle advanced interactions and features such as Discord forms, notifications, and interactive UI behaviors.
Discord Module
Easily send form data to a Discord webhook.
The module supports confirmations, customizable messages, callbacks, and includes a default styled popup that can be overridden with CSS.
HTML
<form id="form-discord" class="card">
<input name="name" placeholder="Name" required>
<input name="email" type="email" placeholder="Email" required>
<textarea name="message" placeholder="Message" required></textarea>
<button>Send</button>
</form>
Example JS
// Initialize the Discord module
const discord = ui.modules.discord({
webhook: "https://discord.com/api/webhooks/XXXX/XXXX",
title: "📩 New Message",
fields: {
name: "Name",
email: "Email",
message: "Message"
},
log: true,
confirm: true,
showPopup: true,
messages: {
success: "Message sent successfully!",
error: "Error sending message!",
confirm: "Do you want to send this message?"
},
onSuccess: () => console.log("Message sent successfully!"),
onError: (err) => console.error("Error sending message:", err)
});
// Bind the form
const form = document.querySelector("#form-discord");
form.addEventListener("submit", e => {
e.preventDefault();
discord.send(form);
});Available Options
| Option | Type | Default | Description |
|-------------|----------|---------|-------------|
| webhook | string | — | Discord webhook URL (required) |
| title | string | "Form" | Title of the Discord embed |
| fields | object | {} | Object mapping form fields { fieldName: label } |
| log | boolean | false | Logs the payload in the console |
| confirm | boolean | false | Enables a confirmation dialog before sending |
| showPopup | boolean | false | Displays a styled popup after submission |
| messages | object | {} | Custom messages for success, error, and confirm |
| onSuccess | function | — | Callback triggered after successful submission |
| onError | function | — | Callback triggered in case of submission error |
You can customize the popup style via CSS by targeting
#ui-discord-popup.
