Flamingo CSS Framework

A lightweight, attribute-based CSS framework by Amr Khaled.

Introduction

Flamingo CSS is a lightweight, attribute-based CSS framework designed to simplify common styling tasks and add engaging visual effects to your web projects. By simply adding specific attributes to your HTML elements, you can apply predefined styles for backgrounds, shapes, animations, hover effects, buttons, and a wide range of colors.

This documentation provides a comprehensive guide to all available attributes, from installation to detailed descriptions and examples.

Installation

To use Flamingo CSS, simply add a <link> tag in the <head> section of your HTML document, pointing to your hosted float.css file:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My Flamingo Project</title>
    <!-- Include Inter font for better typography -->
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;700;800&display=swap" rel="stylesheet">
    <!-- Link to your Flamingo CSS file -->
    <link rel="stylesheet" href="https://685729125b22ba1892bfdb50--tubular-basbousa-c9e2fe.netlify.app/float.css">
</head>
<body>
    <!-- Your content here -->
</body>
</html>

Important Note on Attributes: For Flamingo CSS to work, you apply its custom attributes directly to your HTML elements, **without square brackets** in the HTML tag itself.

For example, to apply flexbox styles for a row, you would write:

<div flex-row>...</div>
And for a purple button, it would be:
<button btn='purple'>...</button>

The `float.css` file contains CSS rules that are internally designed to recognize these attributes without the need for square brackets in your HTML. This allows for a clean and intuitive way to add styles. Please make sure you use the attributes exactly as shown in the examples below for them to work correctly!

Layout Utilities

`flex-row` attribute

Applies `display: flex` with `flex-direction: row`, and centers items horizontally and vertically.

<div flex-row>...</div>
Item 1 Item 2
`flex-column` attribute

Applies `display: flex` with `flex-direction: column`, and centers items horizontally and vertically.

<div flex-column>...</div>
Item 1 Item 2
`center` attribute

Centers an item within its flex container (`align-self: center; justify-self: center;`).

<div flex-row><span center>...</span></div>
Centered

Background Utilities

`bg='auto'` attribute

Sets background to `center`, `no-repeat`, and `cover`.

<div bg='auto'></div>
`glow` attribute

Applies an inset box shadow with a linear gradient, creating a glow effect.

<div glow></div>

Clip-Path Shapes

These attributes apply various geometric shapes using `clip-path`.

`circle` attribute

Clips the element into a perfect circle.

<div circle></div>
Circle
`triangle` attribute

Clips the element into a triangle.

<div triangle></div>
Triangle
`ellipse` attribute

Clips the element into an ellipse.

<div ellipse></div>
Ellipse
`square` attribute

Ensures the element is a square clip path (inset 0).

<div square></div>
Square
`rectangle` attribute

Clips the element into a rectangle (with 10% inset on top/bottom).

<div rectangle></div>
Rectangle
`diamond` attribute

Clips the element into a diamond shape.

<div diamond></div>
Diamond
`hexagon` attribute

Clips the element into a hexagon shape.

<div hexagon></div>
Hexagon
`parallelogram` attribute

Clips the element into a parallelogram.

<div parallelogram></div>
Parallelogram
`star` attribute

Clips the element into a star shape.

<div star></div>
Star
`trapezoid` attribute

Clips the element into a trapezoid shape.

<div trapezoid></div>
Trapezoid
`sharp` attribute

Applies a complex, jagged clip path.

<div sharp></div>
Sharp
`wave` attribute

Applies a wave-like clip path at the top.

<div wave></div>
Wave
`home` attribute

Clips the element into a classic house shape.

<div home></div>
Home
`mobile` attribute

Sets a fixed height and width with border-radius to resemble a mobile phone.

<div mobile></div>
Mobile
`tv` attribute

Clips the element into a television screen shape.

<div tv></div>
TV
`slope` attribute

Clips the element into a sloping parallelogram.

<div slope></div>
Slope
`heart` attribute

Clips the element into a heart shape.

<div heart></div>
Heart
`broken` attribute

Applies a jagged, broken-looking clip path.

<div broken></div>
Broken

Standard Animations

These attributes apply various continuous animations to elements. These are general-purpose motion effects.

`spin` attribute

Continuously rotates the element 360 degrees.

<div spin></div>
Spin
`bounce` attribute

Makes the element bounce vertically.

<div bounce></div>
Bounce
`pulse` attribute

Makes the element grow slightly and fade in/out.

<div pulse></div>
Pulse
`swing` attribute

Makes the element wiggle from side to side.

<div swing></div>
Swing
`fadein` attribute

Fades the element in while sliding up.

<div fadein></div>
Fade In
`flip` attribute

Flips the element horizontally.

<div flip></div>
Flip
`shake` attribute

Makes the element shake horizontally.

<div shake></div>
Shake
`grow` attribute

Makes the element continuously grow and shrink.

<div grow></div>
Grow
`shrink` attribute

Makes the element continuously shrink and grow.

<div shrink></div>
Shrink
`slide-x` attribute

Slides the element horizontally left and right.

<div slide-x></div>
Slide X
`slide-y` attribute

Slides the element vertically up and down.

<div slide-y></div>
Slide Y

Coloring Animations

These attributes apply animated background color changes using predefined palettes.

`coloring` attribute

Applies a generic background color animation (changes every 1s).

<div coloring></div>
Coloring
`coloring-1` to `coloring-50` attributes

Each attribute applies a specific 3-color background animation. Here's an example:

<div coloring-1></div>
Coloring-1
`coloring-2` attribute

Specific 3-color background animation (green, yellow, orange).

<div coloring-2></div>
Coloring-2
`coloring-3` attribute

Specific 3-color background animation (red, cyan, light purple).

<div coloring-3></div>
Coloring-3

... and so on, for `coloring-4` through `coloring-50`, each with a unique color palette.

Floating Ball Animations

These attributes create glowing, animated balls that float across the element using `::before` pseudo-elements. The parent element should have `position: relative` and `overflow: hidden` for best results.

`ball-move-1` attribute

A glowing ball animation with a specific path and speed.

<div style="position: relative; overflow: hidden; height: 150px; width: 100%;" ball-move-1></div>

Ball 1

`ball-move-2` attribute

Another glowing ball animation with a different path and speed.

<div style="position: relative; overflow: hidden; height: 150px; width: 100%;" ball-move-2></div>

Ball 2

`ball-move-3` attribute

A larger glowing ball animation.

<div style="position: relative; overflow: hidden; height: 150px; width: 100%;" ball-move-3></div>

Ball 3

`ball-move-4` attribute

A faster, smaller glowing ball animation.

<div style="position: relative; overflow: hidden; height: 150px; width: 100%;" ball-move-4></div>

Ball 4

`ball-move-5` attribute

A very large, slow glowing ball animation.

<div style="position: relative; overflow: hidden; height: 150px; width: 100%;" ball-move-5></div>

Ball 5

... and so on, for `ball-move-6` through `ball-move-50`, each with different paths, sizes, and speeds (assuming their CSS is defined in `float.css`).

Special Effects Animations

These attributes apply unique visual effects to elements, often using pseudo-elements or SVG filters.

`birthday-paper` attribute

Creates a confetti-like falling paper animation over the element. The parent element should have `position: relative` and `overflow: hidden`.

<div style="position: relative; overflow: hidden; height: 200px;" birthday-paper></div>
Happy Birthday!
`lightfouce` attribute

Applies a subtle, moving spotlight/light focus effect to the element. The element itself should have a background color for the effect to be visible. Needs `position: relative` and `overflow: hidden`.

<div style="height: 150px; background-color: #e3f2fd;" lightfouce></div>
Focused Content
`handdrawn` attribute

Gives the element a hand-drawn or sketchy appearance using an SVG filter, with a hover effect.

<div handdrawn></div>
Sketchy Box

Rotate Utilities

Apply specific rotations to elements. Values range from `rotate-1` to `rotate-180`.

`rotate-45` attribute

Rotates the element 45 degrees.

<div rotate-45></div>
45°
`rotate-90` attribute

Rotates the element 90 degrees.

<div rotate-90></div>
90°
`rotate-180` attribute

Rotates the element 180 degrees.

<div rotate-180></div>
180°

... and so on, for every degree from 1 to 180. E.g., `rotate-1`, `rotate-2`, ..., `rotate-179`.

Hover Effects

These attributes apply a specific effect when the element is hovered over.

`hover-1` attribute (Scale up)

Scales the element up slightly on hover.

<div hover-1></div>
Hover
`hover-2` attribute (Scale down)

Scales the element down slightly on hover.

<div hover-2></div>
Hover
`hover-3` attribute (Rotate)

Rotates the element 8 degrees on hover.

<div hover-3></div>
Hover
`hover-4` attribute (Shadow pop)

Applies a shadow pop effect on hover.

<div hover-4></div>
Hover
`hover-5` attribute (Glow)

Applies a glow effect on hover.

<div hover-5></div>
Hover
`hover-6` attribute (Border color)

Changes border color on hover.

<div hover-6></div>
Hover
`hover-7` attribute (Gradient background)

Applies a gradient background on hover.

<div hover-7></div>
Hover
`hover-8` attribute (Blur)

Applies a blur effect on hover.

<div hover-8></div>
Hover
`hover-9` attribute (Skew)

Skews the element on hover.

<div hover-9></div>
Hover
`hover-10` attribute (Opacity)

Reduces opacity on hover.

<div hover-10></div>
Hover
`hover-11` attribute (Pulse animation)

Applies a pulse animation on hover.

<div hover-11></div>
Hover
`hover-12` attribute (Wiggle animation)

Applies a wiggle animation on hover.

<div hover-12></div>
Hover
`hover-13` attribute (Bounce animation)

Applies a bounce animation on hover.

<div hover-13></div>
Hover
`hover-14` attribute (Flip animation)

Flips the element on hover.

<div hover-14></div>
Hover
`hover-15` attribute (Slide right)

Slides the element right on hover.

<div hover-15></div>
Hover
`hover-16` attribute (Slide left)

Slides the element left on hover.

<div hover-16></div>
Hover
`hover-17` attribute (Slide up)

Slides the element up on hover.

<div hover-17></div>
Hover
`hover-18` attribute (Slide down)

Slides the element down on hover.

<div hover-18></div>
Hover
`hover-19` attribute (Text color)

Changes text color on hover.

<div hover-19></div>
Hover
`hover-20` attribute (Shadow inset)

Applies an inset shadow on hover.

<div hover-20></div>
Hover
`hover-21` attribute (Border radius)

Changes border-radius to 50px on hover.

<div hover-21></div>
Hover
`hover-22` attribute (Grayscale)

Applies a grayscale filter on hover.

<div hover-22></div>
Hover
`hover-23` attribute (Saturate)

Increases saturation on hover.

<div hover-23></div>
Hover
`hover-24` attribute (Hue rotate)

Rotates hue by 90 degrees on hover.

<div hover-24></div>
Hover
`hover-25` attribute (Shadow neon)

Applies a neon shadow on hover.

<div hover-25></div>
Hover
`hover-26` attribute (Border dashed)

Changes border to dashed on hover.

<div hover-26></div>
Hover
`hover-27` attribute (Border dotted)

Changes border to dotted on hover.

<div hover-27></div>
Hover
`hover-28` attribute (Glass effect)

Applies a subtle glass effect on hover.

<div hover-28></div>
Hover
`hover-29` attribute (Shadow color)

Changes shadow color on hover.

<div hover-29></div>
Hover

Morph Hover Effects

These attributes allow an element's clip-path to smoothly transition to a different shape on hover.

`morph-hover="star"` attribute

On hover, the element transitions into a star shape.

<div morph-hover="star" circle></div>
Morph to Star
`morph-hover="circle"` attribute

On hover, the element transitions into a circle shape.

<div morph-hover="circle" square></div>
Morph to Circle
`morph-hover="hexagon"` attribute

On hover, the element transitions into a hexagon shape.

<div morph-hover="hexagon" triangle></div>
Morph to Hexagon
`morph-hover="diamond"` attribute

On hover, the element transitions into a diamond shape.

<div morph-hover="diamond" ellipse></div>
Morph to Diamond

Gradients

Apply modern linear gradients as background colors.

`gradient-1` attribute

Gradient from #6600FF to #FF6FD8.

<div gradient-1></div>
`gradient-2` attribute

Gradient from #43e97b to #38f9d7.

<div gradient-2></div>
`gradient-3` attribute

Gradient from #f7971e to #ffd200.

<div gradient-3></div>
`gradient-4` attribute

Gradient from #f953c6 to #b91d73.

<div gradient-4></div>
`gradient-5` attribute

Gradient from #30cfd0 to #330867.

<div gradient-5></div>
`gradient-6` attribute

Gradient from #5ee7df to #b490ca.

<div gradient-6></div>
`gradient-7` attribute

Gradient from #ee9ca7 to #ffdde1.

<div gradient-7></div>
`gradient-8` attribute

Gradient from #f6d365 to #fda085.

<div gradient-8></div>
`gradient-9` attribute

Gradient from #6600ff to #c6e8f8.

<div gradient-9></div>
`gradient-10` attribute

Gradient from #ffffff to #00c3ff.

<div gradient-10></div>

Components

Card

`card` attribute

A styled card component with padding, border-radius, and shadow.

<div card>...</div>

Card Title

This is some content inside a Flamingo CSS card.

Button

`button` attribute

A styled button with padding, border-radius, background, and hover effects.

<button button>Click Me</button>
`btn='{color}'` attribute

Colored buttons. Replace `{color}` with various predefined colors like `purple`, `blue`, `red`, etc.

<button btn='purple'>Purple</button>
<button btn='green'>Green</button>

Background Colors

Set background colors using attribute selectors for basic colors and various shades (e.g., `red`, `red-500`).

Basic Colors

`red` attribute

Sets background to a vibrant red.

<div red></div>
`pink` attribute

Sets background to a vibrant pink.

<div pink></div>
`purple` attribute

Sets background to a deep purple.

<div purple></div>
`deep-purple` attribute

Sets background to a darker purple.

<div deep-purple></div>
`indigo` attribute

Sets background to an indigo blue.

<div indigo></div>
`blue` attribute

Sets background to a standard blue.

<div blue></div>
`light-blue` attribute

Sets background to a light blue.

<div light-blue></div>
`cyan` attribute

Sets background to a cyan blue.

<div cyan></div>
`teal` attribute

Sets background to a teal green.

<div teal></div>
`green` attribute

Sets background to a vibrant green.

<div green></div>
`light-green` attribute

Sets background to a light green.

<div light-green></div>
`lime` attribute

Sets background to a lime green.

<div lime></div>
`yellow` attribute

Sets background to a golden yellow.

<div yellow></div>
`amber` attribute

Sets background to an amber yellow.

<div amber></div>
`orange` attribute

Sets background to an orange.

<div orange></div>
`deep-orange` attribute

Sets background to a deep orange.

<div deep-orange></div>
`brown` attribute

Sets background to a brown.

<div brown></div>
`gray` attribute

Sets background to a standard gray.

<div gray></div>
`blue-gray` attribute

Sets background to a blue-gray.

<div blue-gray></div>
`black` attribute

Sets background to a dark black.

<div black></div>
`white` attribute

Sets background to white.

<div white></div>
`light` attribute

Sets background to a very light purple/gray.

<div light></div>
`dark` attribute

Sets background to a dark gray/blue.

<div dark></div>

Shaded Colors (e.g., `red-100` to `red-900`)

Each major color (red, blue, green, yellow, purple, gray) has 10 shades from 50 (lightest) to 900 (darkest).

`red-50` to `red-900` attributes

Various shades of red.

<div red-50></div>
<div red-500></div>
<div red-900></div>
`blue-50` to `blue-900` attributes

Various shades of blue.

<div blue-50></div>
<div blue-500></div>
<div blue-900></div>
`green-50` to `green-900` attributes

Various shades of green.

<div green-50></div>
<div green-500></div>
<div green-900></div>
`yellow-50` to `yellow-900` attributes

Various shades of yellow.

<div yellow-50></div>
<div yellow-500></div>
<div yellow-900></div>
`purple-50` to `purple-900` attributes

Various shades of purple.

<div purple-50></div>
<div purple-500></div>
<div purple-900></div>
`gray-50` to `gray-900` attributes

Various shades of gray.

<div gray-50></div>
<div gray-500></div>
<div gray-900></div>

Text Colors

Set text colors using attribute selectors, prefixed with `t` for basic colors and various shades (e.g., `tred`, `tred-500`).

Basic Text Colors

`tred` attribute

Sets text color to a vibrant red.

<span tred>...</span>

Red Text

`tpink` attribute

Sets text color to a vibrant pink.

<span tpink>...</span>

Pink Text

`tpurple` attribute

Sets text color to a deep purple.

<span tpurple>...</span>

Purple Text

`tdeep-purple` attribute

Sets text color to a darker purple.

<span tdeep-purple>...</span>

Deep Purple Text

`tindigo` attribute

Sets text color to an indigo blue.

<span tindigo>...</span>

Indigo Text

`tblue` attribute

Sets text color to a standard blue.

<span tblue>...</span>

Blue Text

`tlight-blue` attribute

Sets text color to a light blue.

<span tlight-blue>...</span>

Light Blue Text

`tcyan` attribute

Sets text color to a cyan blue.

<span tcyan>...</span>

Cyan Text

`tteal` attribute

Sets text color to a teal green.

<span tteal>...</span>

Teal Text

`tgreen` attribute

Sets text color to a vibrant green.

<span tgreen>...</span>

Green Text

`tlight-green` attribute

Sets text color to a light green.

<span tlight-green>...</span>

Light Green Text

`tlime` attribute

Sets text color to a lime green.

<span tlime>...</span>

Lime Text

`tyellow` attribute

Sets text color to a golden yellow.

<span tyellow>...</span>

Yellow Text

`tamber` attribute

Sets text color to an amber yellow.

<span tamber>...</span>

Amber Text

`torange` attribute

Sets text color to an orange.

<span torange>...</span>

Orange Text

`tdeep-orange` attribute

Sets text color to a deep orange.

<span tdeep-orange>...</span>

Deep Orange Text

`tbrown` attribute

Sets text color to a brown.

<span tbrown>...</span>

Brown Text

`tgray` attribute

Sets text color to a standard gray.

<span tgray>...</span>

Gray Text

`tblue-gray` attribute

Sets text color to a blue-gray.

<span tblue-gray>...</span>

Blue-Gray Text

`tblack` attribute

Sets text color to a dark black.

<span tblack>...</span>

Black Text

`twhite` attribute

Sets text color to white.

<span twhite>...</span>

White Text

`tlight` attribute

Sets text color to a very light purple/gray.

<span tlight>...</span>

Light Text

`tdark` attribute

Sets text color to a dark gray/blue.

<span tdark>...</span>

Dark Text

Shaded Text Colors (e.g., `tred-100` to `tred-900`)

Each major color (red, blue, green, yellow, purple, gray) has 10 shades from 50 (lightest) to 900 (darkest).

`tred-50` to `tred-900` attributes

Various shades of red text.

<span tred-50>Text</span>
<span tred-500>Text</span>
<span tred-900>Text</span>
Text Text Text Text Text
`tblue-50` to `tblue-900` attributes

Various shades of blue text.

<span tblue-50>Text</span>
Text Text Text Text Text
`tgreen-50` to `tgreen-900` attributes

Various shades of green text.

<span tgreen-50>Text</span>
Text Text Text Text Text
`tyellow-50` to `tyellow-900` attributes

Various shades of yellow text.

<span tyellow-50>Text</span>
Text Text Text Text Text
`tpurple-50` to `tpurple-900` attributes

Various shades of purple text.

<span tpurple-50>Text</span>
Text Text Text Text Text
`tgray-50` to `tgray-900` attributes

Various shades of gray text.

<span tgray-50>Text</span>
Text Text Text Text Text